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

Unified Diff: net/spdy/spdy_test_util_common.cc

Issue 1215933004: New new versions of Starts/EndsWith and SplitString in net (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@starts_with
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: net/spdy/spdy_test_util_common.cc
diff --git a/net/spdy/spdy_test_util_common.cc b/net/spdy/spdy_test_util_common.cc
index 846f96557cf50da4252f8128f1248dbd3129f33e..2a00140d7ef26f5fad1e4cafbfa355b22ea82ef3 100644
--- a/net/spdy/spdy_test_util_common.cc
+++ b/net/spdy/spdy_test_util_common.cc
@@ -869,11 +869,10 @@ std::string SpdyTestUtil::ConstructSpdyReplyString(
// above).
if (spdy_version() >= SPDY3 && key[0] == ':')
key = key.substr(1);
- std::vector<std::string> values;
- base::SplitString(it->second, '\0', &values);
- for (std::vector<std::string>::const_iterator it2 = values.begin();
- it2 != values.end(); ++it2) {
- reply_string += key + ": " + *it2 + "\n";
+ for (const std::string& value :
+ base::SplitString(it->second, base::StringPiece("\0", 1),
+ base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) {
+ reply_string += key + ": " + value + "\n";
}
}
return reply_string;

Powered by Google App Engine
This is Rietveld 408576698