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

Unified Diff: third_party/WebKit/Source/wtf/text/StringImpl.cpp

Issue 1508423004: Remove String::reverseFindIgnoringCase (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « third_party/WebKit/Source/wtf/text/StringImpl.h ('k') | third_party/WebKit/Source/wtf/text/WTFString.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/text/StringImpl.cpp
diff --git a/third_party/WebKit/Source/wtf/text/StringImpl.cpp b/third_party/WebKit/Source/wtf/text/StringImpl.cpp
index d3a07291b752994886c2f1f7e30386b70acef3da..3eb20fafa09863a5f2b07ee43fe90946ec56d42f 100644
--- a/third_party/WebKit/Source/wtf/text/StringImpl.cpp
+++ b/third_party/WebKit/Source/wtf/text/StringImpl.cpp
@@ -1425,47 +1425,6 @@ size_t StringImpl::reverseFind(StringImpl* matchString, unsigned index)
return reverseFindInner(characters16(), matchString->characters16(), index, ourLength, matchLength);
}
-template <typename SearchCharacterType, typename MatchCharacterType>
-ALWAYS_INLINE static size_t reverseFindIgnoringCaseInner(const SearchCharacterType* searchCharacters, const MatchCharacterType* matchCharacters, unsigned index, unsigned length, unsigned matchLength)
-{
- // delta is the number of additional times to test; delta == 0 means test only once.
- unsigned delta = min(index, length - matchLength);
-
- // keep looping until we match
- while (!equalIgnoringCase(searchCharacters + delta, matchCharacters, matchLength)) {
- if (!delta)
- return kNotFound;
- --delta;
- }
- return delta;
-}
-
-size_t StringImpl::reverseFindIgnoringCase(StringImpl* matchString, unsigned index)
-{
- // Check for null or empty string to match against
- if (!matchString)
- return kNotFound;
- unsigned matchLength = matchString->length();
- unsigned ourLength = length();
- if (!matchLength)
- return min(index, ourLength);
-
- // Check index & matchLength are in range.
- if (matchLength > ourLength)
- return kNotFound;
-
- if (is8Bit()) {
- if (matchString->is8Bit())
- return reverseFindIgnoringCaseInner(characters8(), matchString->characters8(), index, ourLength, matchLength);
- return reverseFindIgnoringCaseInner(characters8(), matchString->characters16(), index, ourLength, matchLength);
- }
-
- if (matchString->is8Bit())
- return reverseFindIgnoringCaseInner(characters16(), matchString->characters8(), index, ourLength, matchLength);
-
- return reverseFindIgnoringCaseInner(characters16(), matchString->characters16(), index, ourLength, matchLength);
-}
-
ALWAYS_INLINE static bool equalInner(const StringImpl* stringImpl, unsigned startOffset, const LChar* matchString, unsigned matchLength)
{
ASSERT(stringImpl);
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringImpl.h ('k') | third_party/WebKit/Source/wtf/text/WTFString.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698