summaryrefslogtreecommitdiffstats
path: root/chrome/browser/history/text_database.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/history/text_database.cc')
-rw-r--r--chrome/browser/history/text_database.cc9
1 files changed, 2 insertions, 7 deletions
diff --git a/chrome/browser/history/text_database.cc b/chrome/browser/history/text_database.cc
index c5da03c..bb70fc7 100644
--- a/chrome/browser/history/text_database.cc
+++ b/chrome/browser/history/text_database.cc
@@ -111,14 +111,9 @@ TextDatabase::DBIdent TextDatabase::FileNameToID(const FilePath& file_path) {
return 0;
}
- // TODO: Once StringPiece supports a templated interface over the
- // underlying string type, use it here instead of substr, since that
- // will avoid needless string copies. StringPiece cannot be used
- // right now because FilePath::StringType could use either 8 or 16 bit
- // characters, depending on the OS.
int year, month;
- base::StringToInt(suffix.substr(0, 4), &year);
- base::StringToInt(suffix.substr(5, 2), &month);
+ base::StringToInt(suffix.begin(), suffix.begin() + 4, &year);
+ base::StringToInt(suffix.begin() + 5, suffix.begin() + 7, &month);
return year * 100 + month;
}