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

Unified Diff: net/tools/balsa/string_piece_utils.h

Issue 1224553010: Replace base::str[n]casecmp with helper functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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
« no previous file with comments | « net/tools/balsa/balsa_headers.h ('k') | net/tools/quic/test_tools/http_message.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/balsa/string_piece_utils.h
diff --git a/net/tools/balsa/string_piece_utils.h b/net/tools/balsa/string_piece_utils.h
index 7d8a1aaaee28733cd8afe70374822a91c4e3b9f8..6d8967a014219416c98ec37b75e1401d5de6fcd9 100644
--- a/net/tools/balsa/string_piece_utils.h
+++ b/net/tools/balsa/string_piece_utils.h
@@ -65,31 +65,10 @@ struct StringPieceCaseHash {
};
#endif // COMPILER_MSVC
-struct StringPieceUtils {
- // ASCII case-insensitive equality.
- static bool EqualIgnoreCase(const base::StringPiece& piece1,
- const base::StringPiece& piece2) {
- base::StringPiece::const_iterator p1i = piece1.begin();
- base::StringPiece::const_iterator p2i = piece2.begin();
- if (piece1.empty() && piece2.empty()) {
- return true;
- } else if (piece1.size() != piece2.size()) {
- return false;
- }
- while (p1i != piece1.end() && p2i != piece2.end()) {
- if (base::ToLowerASCII(*p1i) != base::ToLowerASCII(*p2i))
- return false;
- ++p1i;
- ++p2i;
- }
- return true;
- }
-};
-
struct StringPieceCaseEqual {
bool operator()(const base::StringPiece& piece1,
const base::StringPiece& piece2) const {
- return StringPieceUtils::EqualIgnoreCase(piece1, piece2);
+ return base::EqualsCaseInsensitiveASCII(piece1, piece2);
}
};
« no previous file with comments | « net/tools/balsa/balsa_headers.h ('k') | net/tools/quic/test_tools/http_message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698