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

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

Issue 2036993002: Revert of Switch WTF::find on LChar to use memchr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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: 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 850c54ab74e45d896dffa4e3b8c38464a6ebee9e..161fa19be061c9ad496f7190c45a2f565eda7fc0 100644
--- a/third_party/WebKit/Source/wtf/text/StringImpl.h
+++ b/third_party/WebKit/Source/wtf/text/StringImpl.h
@@ -31,7 +31,6 @@
#include "wtf/WTFExport.h"
#include "wtf/text/Unicode.h"
#include <limits.h>
-#include <string.h>
#if OS(MACOSX)
typedef const struct __CFString * CFStringRef;
@@ -519,14 +518,8 @@
WTF_EXPORT int codePointCompareIgnoringASCIICase(const StringImpl*, const LChar*);
-inline size_t find(const LChar* characters, unsigned length, LChar matchCharacter, unsigned index = 0)
-{
- const LChar* found = static_cast<const LChar*>(
- memchr(characters + index, matchCharacter, length - index));
- return found ? found - characters : kNotFound;
-}
-
-inline size_t find(const UChar* characters, unsigned length, UChar matchCharacter, unsigned index = 0)
+template<typename CharacterType>
+inline size_t find(const CharacterType* characters, unsigned length, CharacterType matchCharacter, unsigned index = 0)
{
while (index < length) {
if (characters[index] == matchCharacter)
@@ -545,12 +538,6 @@
{
if (matchCharacter & ~0xFF)
return kNotFound;
- return find(characters, length, static_cast<LChar>(matchCharacter), index);
-}
-
-template <typename CharacterType>
-inline size_t find(const CharacterType* characters, unsigned length, char matchCharacter, unsigned index = 0)
-{
return find(characters, length, static_cast<LChar>(matchCharacter), index);
}
« 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