| Index: chromeos/system/version_loader.cc
|
| diff --git a/chromeos/system/version_loader.cc b/chromeos/system/version_loader.cc
|
| index a5604d8f16d176160598ea8d3adcce314bfb2766..ab9505b6274f27040faa0a60f6764ffd5bedb42f 100644
|
| --- a/chromeos/system/version_loader.cc
|
| +++ b/chromeos/system/version_loader.cc
|
| @@ -75,12 +75,12 @@ std::string ParseFirmware(const std::string& contents) {
|
| // fixed. So we just match kFirmwarePrefix at the start of the line and find
|
| // the first character that is not "|" or space
|
|
|
| - std::vector<std::string> lines;
|
| - base::SplitString(contents, '\n', &lines);
|
| - for (size_t i = 0; i < lines.size(); ++i) {
|
| - if (base::StartsWith(lines[i], kFirmwarePrefix,
|
| + base::StringPiece firmware_prefix(kFirmwarePrefix);
|
| + for (const std::string& line : base::SplitString(
|
| + contents, "\n", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) {
|
| + if (base::StartsWith(line, firmware_prefix,
|
| base::CompareCase::INSENSITIVE_ASCII)) {
|
| - std::string str = lines[i].substr(std::string(kFirmwarePrefix).size());
|
| + std::string str = line.substr(firmware_prefix.size());
|
| size_t found = str.find_first_not_of("| ");
|
| if (found != std::string::npos)
|
| return str.substr(found);
|
|
|