Chromium Code Reviews| 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; |
| } |