summaryrefslogtreecommitdiffstats
path: root/chromeos/system/version_loader.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromeos/system/version_loader.cc')
-rw-r--r--chromeos/system/version_loader.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/chromeos/system/version_loader.cc b/chromeos/system/version_loader.cc
index a5604d8..ab9505b 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);