Ignore:
Timestamp:
Jul 16, 2008, 1:19:56 PM (17 years ago)
Author:
[email protected]
Message:

2008-07-16 Sam Weinig <[email protected]>

Reviewed by Steve Falkenburg.

Replace adopting UString constructor in favor of explicit
static adopt method.

  • API/JSStringRefCF.cpp: (JSStringCreateWithCFString):
  • kjs/StringConstructor.cpp: (KJS::stringFromCharCode):
  • kjs/StringPrototype.cpp: (KJS::stringProtoFuncToLowerCase): (KJS::stringProtoFuncToUpperCase): (KJS::stringProtoFuncToLocaleLowerCase): (KJS::stringProtoFuncToLocaleUpperCase):
  • kjs/ustring.cpp: (KJS::UString::adopt):
  • kjs/ustring.h: (KJS::UString::UString): (KJS::UString::~UString):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/ustring.cpp

    r35177 r35199  
    455455    else
    456456        m_rep = Rep::createCopying(c, length);
    457 }
    458 
    459 UString::UString(UChar* c, int length, bool copy)
    460 {
    461     if (length == 0)
    462         m_rep = &Rep::empty;
    463     else if (copy)
    464         m_rep = Rep::createCopying(c, length);
    465     else
    466         m_rep = Rep::create(c, length);
    467457}
    468458
     
    531521}
    532522
     523UString UString::adopt(UChar* c, int length)
     524{
     525    if (length == 0)
     526        return UString("");
     527   return UString(Rep::create(c, length));
     528}
     529
     530UString UString::adopt(Vector<UChar>& buffer)
     531{
     532    if (buffer.isEmpty())
     533        return UString("");
     534   return UString(Rep::create(buffer.releaseBuffer(), buffer.size()));
     535}
     536
    533537const UString& UString::null()
    534538{
Note: See TracChangeset for help on using the changeset viewer.