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..0154bd492017070937dea844ace85765307d408e 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::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) { |
+ 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; |
} |