Skip to content
  • msaboff@apple.com's avatar
    Try to create AtomicString as 8 bit where possible · 85d45dc8
    msaboff@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=100575
    
    Reviewed by Oliver Hunt.
    
    Added StringImpl::create8BitIfPossible() that first tries to create an 8 bit string.  If it finds a 16 bit character
    during processing, it calls the standard create() method.  The assumption is that this will be used on mostly 8 bit
    strings and ones that are shorter (in the tens of characters).  Changed AtomicString to use the new creation method
    for UChar based construction.
    
    * wtf/text/AtomicString.cpp:
    (WTF::UCharBufferTranslator::translate):
    * wtf/text/StringImpl.cpp:
    (WTF::StringImpl::create8BitIfPossible):
    * wtf/text/StringImpl.h:
    (WTF::StringImpl::create8BitIfPossible):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132739 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    85d45dc8