Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(709)

Unified Diff: components/device_event_log/device_event_log_impl_unittest.cc

Issue 1234973004: Update SplitString calls in components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/device_event_log/device_event_log_impl_unittest.cc
diff --git a/components/device_event_log/device_event_log_impl_unittest.cc b/components/device_event_log/device_event_log_impl_unittest.cc
index 706039d9c647986cbaa2b029683288b9e8ceec56..0ef743bc1e8a999086fbbda3c3b9e1e292860d8a 100644
--- a/components/device_event_log/device_event_log_impl_unittest.cc
+++ b/components/device_event_log/device_event_log_impl_unittest.cc
@@ -53,14 +53,13 @@ class DeviceEventLogTest : public testing::Test {
protected:
std::string SkipTime(const std::string& input) {
std::string output;
- std::vector<std::string> lines;
- base::SplitString(input, '\n', &lines);
- for (size_t i = 0; i < lines.size(); ++i) {
- size_t n = lines[i].find(']');
+ for (const std::string& line : base::SplitString(
+ input, "\n", base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL)) {
yzshen1 2015/07/22 22:50:34 TRIM_WHITESPACE
+ size_t n = line.find(']');
if (n != std::string::npos)
- output += "[time] " + lines[i].substr(n + 2) + '\n';
+ output += "[time] " + line.substr(n + 2) + '\n';
else
- output += lines[i];
+ output += line;
}
return output;
}

Powered by Google App Engine
This is Rietveld 408576698