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

Side by Side Diff: Source/wtf/text/StringImpl.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 unified diff | Download patch
« no previous file with comments | « Source/wtf/text/StringHash.h ('k') | Source/wtf/text/StringImpl.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved.
4 * Copyright (C) 2009 Google Inc. All rights reserved. 4 * Copyright (C) 2009 Google Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 #if USE(CF) 414 #if USE(CF)
415 RetainPtr<CFStringRef> createCFString(); 415 RetainPtr<CFStringRef> createCFString();
416 #endif 416 #endif
417 #ifdef __OBJC__ 417 #ifdef __OBJC__
418 operator NSString*(); 418 operator NSString*();
419 #endif 419 #endif
420 420
421 #ifdef STRING_STATS 421 #ifdef STRING_STATS
422 ALWAYS_INLINE static StringStats& stringStats() { return m_stringStats; } 422 ALWAYS_INLINE static StringStats& stringStats() { return m_stringStats; }
423 #endif 423 #endif
424 static const UChar latin1CaseFoldTable[256];
424 425
425 private: 426 private:
426 template<typename CharType> static size_t allocationSize(unsigned length) 427 template<typename CharType> static size_t allocationSize(unsigned length)
427 { 428 {
428 RELEASE_ASSERT(length <= ((std::numeric_limits<unsigned>::max() - sizeof (StringImpl)) / sizeof(CharType))); 429 RELEASE_ASSERT(length <= ((std::numeric_limits<unsigned>::max() - sizeof (StringImpl)) / sizeof(CharType)));
429 return sizeof(StringImpl) + length * sizeof(CharType); 430 return sizeof(StringImpl) + length * sizeof(CharType);
430 } 431 }
431 432
432 template <class UCharPredicate> PassRefPtr<StringImpl> stripMatchedCharacter s(UCharPredicate); 433 template <class UCharPredicate> PassRefPtr<StringImpl> stripMatchedCharacter s(UCharPredicate);
433 template <typename CharType, class UCharPredicate> PassRefPtr<StringImpl> si mplifyMatchedCharactersToSpace(UCharPredicate, StripBehavior); 434 template <typename CharType, class UCharPredicate> PassRefPtr<StringImpl> si mplifyMatchedCharactersToSpace(UCharPredicate, StripBehavior);
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 } 771 }
771 772
772 using WTF::StringImpl; 773 using WTF::StringImpl;
773 using WTF::equal; 774 using WTF::equal;
774 using WTF::equalNonNull; 775 using WTF::equalNonNull;
775 using WTF::TextCaseSensitivity; 776 using WTF::TextCaseSensitivity;
776 using WTF::TextCaseSensitive; 777 using WTF::TextCaseSensitive;
777 using WTF::TextCaseInsensitive; 778 using WTF::TextCaseInsensitive;
778 779
779 #endif 780 #endif
OLDNEW
« no previous file with comments | « Source/wtf/text/StringHash.h ('k') | Source/wtf/text/StringImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698