diff options
author | iceman <iceman@yandex-team.ru> | 2015-08-11 10:31:56 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-11 17:32:53 +0000 |
commit | df3bc178a2487a0c2ad4c5b06934f11f155eb441 (patch) | |
tree | 01dbc16c6bde277e29c42e44bc69cff01f42ffc6 /base | |
parent | 528e2652264a2c5d10aca2ace27659c53b2ee4c2 (diff) | |
download | chromium_src-df3bc178a2487a0c2ad4c5b06934f11f155eb441.zip chromium_src-df3bc178a2487a0c2ad4c5b06934f11f155eb441.tar.gz chromium_src-df3bc178a2487a0c2ad4c5b06934f11f155eb441.tar.bz2 |
Remove outdated versions of StartsWith and EndsWith from string_util.cc
It seems that old versions of StartsWith and EndsWith are unused
and can be removed completely.
R=brettw
BUG=none
Review URL: https://codereview.chromium.org/1278973004
Cr-Commit-Position: refs/heads/master@{#342838}
Diffstat (limited to 'base')
-rw-r--r-- | base/strings/string_util.cc | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/base/strings/string_util.cc b/base/strings/string_util.cc index 19c38d5..a389dc3 100644 --- a/base/strings/string_util.cc +++ b/base/strings/string_util.cc @@ -625,23 +625,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, @@ -676,28 +659,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') |