Changeset 11684 in webkit for trunk/JavaScriptCore/kjs/identifier.cpp
- Timestamp:
- Dec 20, 2005, 12:12:50 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/identifier.cpp
r11661 r11684 124 124 } 125 125 126 UString::Rep *Identifier::add(const char *c)126 PassRefPtr<UString::Rep> Identifier::add(const char *c) 127 127 { 128 128 if (!c) 129 return &UString::Rep::null;129 return pass(&UString::Rep::null); 130 130 int length = strlen(c); 131 131 if (length == 0) 132 return &UString::Rep::empty;132 return pass(&UString::Rep::empty); 133 133 134 return *identifierTable().insert<const char *, hash, KJS::equal, convert>(c).first;134 return pass(*identifierTable().insert<const char *, hash, KJS::equal, convert>(c).first); 135 135 } 136 136 … … 164 164 } 165 165 166 UString::Rep *Identifier::add(const UChar *s, int length)166 PassRefPtr<UString::Rep> Identifier::add(const UChar *s, int length) 167 167 { 168 168 if (length == 0) 169 return &UString::Rep::empty;169 return pass(&UString::Rep::empty); 170 170 171 171 UCharBuffer buf = {s, length}; 172 return *identifierTable().insert<UCharBuffer, hash, KJS::equal, convert>(buf).first;173 } 174 175 UString::Rep *Identifier::add(UString::Rep *r)172 return pass(*identifierTable().insert<UCharBuffer, hash, KJS::equal, convert>(buf).first); 173 } 174 175 PassRefPtr<UString::Rep> Identifier::add(UString::Rep *r) 176 176 { 177 177 if (r->isIdentifier) 178 return r;178 return pass(r); 179 179 180 180 if (r->len == 0) 181 return &UString::Rep::empty;181 return pass(&UString::Rep::empty); 182 182 183 183 UString::Rep *result = *identifierTable().insert(r).first; 184 184 if (result == r) 185 185 r->isIdentifier = true; 186 return result;186 return pass(result); 187 187 } 188 188
Note:
See TracChangeset
for help on using the changeset viewer.