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

Unified Diff: base/strings/string_util.cc

Issue 1278973004: Remove outdated versions of StartsWith and EndsWith from string_util.cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/strings/string_util.cc
diff --git a/base/strings/string_util.cc b/base/strings/string_util.cc
index 725d86da8ac7c64693f566c0fdb7b9cd23968b44..d063705541eda3000333c911b05cfde75eb5724a 100644
--- a/base/strings/string_util.cc
+++ b/base/strings/string_util.cc
@@ -587,23 +587,6 @@ bool StartsWith(StringPiece16 str,
return StartsWithT<string16>(str, search_for, case_sensitivity);
}
-bool StartsWith(const string16& str,
- const string16& search,
- bool case_sensitive) {
- if (!case_sensitive) {
- // This function was originally written using the current locale functions
- // for case-insensitive comparisons. Emulate this behavior until callers
- // can be converted either to use the case-insensitive ASCII one (most
- // callers) or ICU functions in base_i18n.
- if (search.size() > str.size())
- return false;
- return std::equal(search.begin(), search.end(), str.begin(),
- CaseInsensitiveCompareDeprecated());
- }
- return StartsWith(StringPiece16(str), StringPiece16(search),
- CompareCase::SENSITIVE);
-}
-
template <typename Str>
bool EndsWithT(BasicStringPiece<Str> str,
BasicStringPiece<Str> search_for,
@@ -638,28 +621,10 @@ bool EndsWith(StringPiece str,
bool EndsWith(StringPiece16 str,
StringPiece16 search_for,
- CompareCase case_sensitivity) {
+ CompareCase case_sensitivity) {
return EndsWithT<string16>(str, search_for, case_sensitivity);
}
-bool EndsWith(const string16& str,
- const string16& search,
- bool case_sensitive) {
- if (!case_sensitive) {
- // This function was originally written using the current locale functions
- // for case-insensitive comparisons. Emulate this behavior until callers
- // can be converted either to use the case-insensitive ASCII one (most
- // callers) or ICU functions in base_i18n.
- if (search.size() > str.size())
- return false;
- return std::equal(search.begin(), search.end(),
- str.begin() + (str.size() - search.size()),
- CaseInsensitiveCompareDeprecated());
- }
- return EndsWith(StringPiece16(str), StringPiece16(search),
- CompareCase::SENSITIVE);
-}
-
char HexDigitToInt(wchar_t c) {
DCHECK(IsHexDigit(c));
if (c >= '0' && c <= '9')
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698