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

Unified Diff: net/http/http_request_headers.cc

Issue 1224553010: Replace base::str[n]casecmp with helper functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert CLD 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/http/http_request_headers.cc
diff --git a/net/http/http_request_headers.cc b/net/http/http_request_headers.cc
index 004d0659512c62ec3d35b40d1abd6926171cfe8b..c2eee59af95f8408a9d11ad774986e302270175b 100644
--- a/net/http/http_request_headers.cc
+++ b/net/http/http_request_headers.cc
@@ -241,8 +241,7 @@ HttpRequestHeaders::HeaderVector::iterator
HttpRequestHeaders::FindHeader(const base::StringPiece& key) {
for (HeaderVector::iterator it = headers_.begin();
it != headers_.end(); ++it) {
- if (key.length() == it->key.length() &&
Nico 2015/07/08 21:58:24 Don't you need this check in case one string piece
brettw 2015/07/08 22:35:17 I don't follow. the new base one deals exclusively
Nico 2015/07/08 22:44:33 Yes, I confused myself here.
- !base::strncasecmp(key.data(), it->key.data(), key.length()))
+ if (base::EqualsCaseInsensitiveASCII(key, it->key))
return it;
}
@@ -253,8 +252,7 @@ HttpRequestHeaders::HeaderVector::const_iterator
HttpRequestHeaders::FindHeader(const base::StringPiece& key) const {
for (HeaderVector::const_iterator it = headers_.begin();
it != headers_.end(); ++it) {
- if (key.length() == it->key.length() &&
- !base::strncasecmp(key.data(), it->key.data(), key.length()))
Nico 2015/07/08 21:58:24 likewise
+ if (base::EqualsCaseInsensitiveASCII(key, it->key))
return it;
}

Powered by Google App Engine
This is Rietveld 408576698