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

Unified Diff: Source/wtf/text/StringHash.h

Issue 1152163005: Speed up case folding for 8-bit strings (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added a unit test Created 5 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 | Source/wtf/text/StringImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/text/StringHash.h
diff --git a/Source/wtf/text/StringHash.h b/Source/wtf/text/StringHash.h
index 3b54b7a9fe4708a00a9bfe9e5104588e6f728814..a5bb00cf0e3b1f0b970465bd2375f916d0c308a3 100644
--- a/Source/wtf/text/StringHash.h
+++ b/Source/wtf/text/StringHash.h
@@ -126,6 +126,8 @@ namespace WTF {
// correctly-folded code point in all cases (see comment below).
template<typename T> static inline UChar foldCase(T ch)
{
+ if (IsSameType<T, LChar>::value)
+ return StringImpl::latin1CaseFoldTable[ch];
// It's possible for WTF::Unicode::foldCase() to return a 32-bit
// value that's not representable as a UChar. However, since this
// is rare and deterministic, and the result of this is merely used
« no previous file with comments | « no previous file | Source/wtf/text/StringImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698