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

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

Issue 2225173002: Use StringView for String::find. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing null check. Created 4 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
Index: third_party/WebKit/Source/wtf/text/StringImpl.h
diff --git a/third_party/WebKit/Source/wtf/text/StringImpl.h b/third_party/WebKit/Source/wtf/text/StringImpl.h
index 89bef3aca80248d8aeac492729465e9022ccb059..1311c0d9f20c317405474afb04a41d9a569ef716 100644
--- a/third_party/WebKit/Source/wtf/text/StringImpl.h
+++ b/third_party/WebKit/Source/wtf/text/StringImpl.h
@@ -366,18 +366,16 @@ public:
template <typename CharType>
ALWAYS_INLINE PassRefPtr<StringImpl> removeCharacters(const CharType* characters, CharacterMatchFunctionPtr);
+ // Find characters.
size_t find(LChar character, unsigned start = 0);
size_t find(char character, unsigned start = 0);
size_t find(UChar character, unsigned start = 0);
size_t find(CharacterMatchFunctionPtr, unsigned index = 0);
- size_t find(const LChar*, unsigned index = 0);
- ALWAYS_INLINE size_t find(const char* s, unsigned index = 0) { return find(reinterpret_cast<const LChar*>(s), index); }
- size_t find(StringImpl*);
- size_t find(StringImpl*, unsigned index);
- size_t findIgnoringCase(const LChar*, unsigned index = 0);
- ALWAYS_INLINE size_t findIgnoringCase(const char* s, unsigned index = 0) { return findIgnoringCase(reinterpret_cast<const LChar*>(s), index); }
- size_t findIgnoringCase(StringImpl*, unsigned index = 0);
- size_t findIgnoringASCIICase(StringImpl*, unsigned index = 0);
+
+ // Find substrings.
+ size_t find(const StringView&, unsigned index = 0);
+ size_t findIgnoringCase(const StringView&, unsigned index = 0);
+ size_t findIgnoringASCIICase(const StringView&, unsigned index = 0);
size_t reverseFind(UChar, unsigned index = UINT_MAX);
size_t reverseFind(StringImpl*, unsigned index = UINT_MAX);
« no previous file with comments | « third_party/WebKit/Source/wtf/text/AtomicString.h ('k') | third_party/WebKit/Source/wtf/text/StringImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698