Index: base/strings/string_util.cc |
diff --git a/base/strings/string_util.cc b/base/strings/string_util.cc |
index 6f6d6e2b6bd240997c822374adf3126108881d9e..9fd823aa964e847619c55f53800238c270e368f0 100644 |
--- a/base/strings/string_util.cc |
+++ b/base/strings/string_util.cc |
@@ -420,14 +420,12 @@ bool IsStringUTF8(const StringPiece& str) { |
return true; |
} |
-} // namespace base |
- |
template<typename Iter> |
static inline bool DoLowerCaseEqualsASCII(Iter a_begin, |
Iter a_end, |
const char* b) { |
for (Iter it = a_begin; it != a_end; ++it, ++b) { |
- if (!*b || base::ToLowerASCII(*it) != *b) |
+ if (!*b || ToLowerASCII(*it) != *b) |
return false; |
} |
return *b == 0; |
@@ -460,12 +458,26 @@ bool LowerCaseEqualsASCII(const char* a_begin, |
return DoLowerCaseEqualsASCII(a_begin, a_end, b); |
} |
+bool LowerCaseEqualsASCII(const char* a_begin, |
+ const char* a_end, |
+ const char* b_begin, |
+ const char* b_end) { |
+ while (a_begin != a_end && b_begin != b_end && |
+ ToLowerASCII(*a_begin) == *b_begin) { |
+ a_begin++; |
+ b_begin++; |
+ } |
+ return a_begin == a_end && b_begin == b_end; |
+} |
+ |
bool LowerCaseEqualsASCII(const char16* a_begin, |
const char16* a_end, |
const char* b) { |
return DoLowerCaseEqualsASCII(a_begin, a_end, b); |
} |
+} // namespace base |
+ |
bool EqualsASCII(const string16& a, const base::StringPiece& b) { |
if (a.length() != b.length()) |
return false; |