Ignore:
Timestamp:
Dec 25, 2005, 1:22:35 AM (19 years ago)
Author:
mjs
Message:

Reviewed by Eric and Dave Hyatt.

This is a somewhat cheesy change. Having to use PassRefPtr_Ref creates ambiguities
in assignment and copy construction. And this makes life way easier and removes
the need for pass(). It is not really correct, but we pretty much never need a real
const PassRefPtr, and this takes care of things for PassRefPtr temporaries.

  • kjs/identifier.cpp: (KJS::Identifier::add): No more need for pass()
  • kjs/property_map.cpp: (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList): No more need for pass()
  • kjs/ustring.cpp: (KJS::UString::Rep::create): Use adoptRef (KJS::UString::UString): No more need for pass (KJS::UString::append): No more need for pass (KJS::UString::substr): No more need for pass
  • kxmlcore/PassRefPtr.h: made m_ptr mutable (ugh) (KXMLCore::PassRefPtr::PassRefPtr): Take a const PassRefPtr reference (KXMLCore::PassRefPtr::release): Made this a const method (ugh) (KXMLCore::PassRefPtr::operator=): clean up appropriately (KXMLCore::adoptRef): Added this to use instead of PassRefPtr<T>::adopt, I think it makes the behavior more clear and it is less verbose. (KXMLCore::static_pointer_cast): use adoptRef (KXMLCore::const_pointer_cast): use adoptRef
  • kxmlcore/RefPtr.h: (KXMLCore::RefPtr::RefPtr): take const PassRefPtr& (KXMLCore::PassRefPtr::operator=): take const PassRefPtr&
File:
1 edited

Legend:

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

    r11739 r11763  
    130130{
    131131    if (!c)
    132         return pass(&UString::Rep::null);
     132        return &UString::Rep::null;
    133133    int length = strlen(c);
    134134    if (length == 0)
    135         return pass(&UString::Rep::empty);
     135        return &UString::Rep::empty;
    136136   
    137     return pass(*identifierTable().insert<const char *, CStringTranslator>(c).first);
     137    return *identifierTable().insert<const char *, CStringTranslator>(c).first;
    138138}
    139139
     
    173173{
    174174    if (length == 0)
    175         return pass(&UString::Rep::empty);
     175        return &UString::Rep::empty;
    176176   
    177177    UCharBuffer buf = {s, length};
    178     return pass(*identifierTable().insert<UCharBuffer, UCharBufferTranslator>(buf).first);
     178    return *identifierTable().insert<UCharBuffer, UCharBufferTranslator>(buf).first;
    179179}
    180180
     
    182182{
    183183    if (r->isIdentifier)
    184         return pass(r);
     184        return r;
    185185
    186186    if (r->len == 0)
    187         return pass(&UString::Rep::empty);
     187        return &UString::Rep::empty;
    188188
    189189    UString::Rep *result = *identifierTable().insert(r).first;
    190190    if (result == r)
    191191        r->isIdentifier = true;
    192     return pass(result);
     192    return result;
    193193}
    194194
Note: See TracChangeset for help on using the changeset viewer.