Changeset 11763 in webkit for trunk/JavaScriptCore/kjs/ustring.cpp
- Timestamp:
- Dec 25, 2005, 1:22:35 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/ustring.cpp
r11684 r11763 202 202 203 203 // steal the single reference this Rep was created with 204 return PassRefPtr<Rep>::adopt(r);204 return adoptRef(r); 205 205 } 206 206 … … 232 232 233 233 // steal the single reference this Rep was created with 234 return PassRefPtr<Rep>::adopt(r);234 return adoptRef(r); 235 235 } 236 236 … … 460 460 x.expandCapacity(aOffset + length); 461 461 memcpy(const_cast<UChar *>(a.data() + aSize), b.data(), bSize * sizeof(UChar)); 462 m_rep = Rep::create( pass(a.m_rep), 0, length);462 m_rep = Rep::create(a.m_rep, 0, length); 463 463 } else if (-bOffset == b.usedPreCapacity() && 4 * bSize >= aSize) { 464 464 // - b reaches the beginning of its buffer so it qualifies for shared prepend … … 468 468 y.expandPreCapacity(-bOffset + aSize); 469 469 memcpy(const_cast<UChar *>(b.data() - aSize), a.data(), aSize * sizeof(UChar)); 470 m_rep = Rep::create( pass(b.m_rep), -aSize, length);470 m_rep = Rep::create(b.m_rep, -aSize, length); 471 471 } else { 472 472 // a does not qualify for append, and b does not qualify for prepend, gotta make a whole new string … … 686 686 expandCapacity(thisOffset + length); 687 687 memcpy(const_cast<UChar *>(data() + thisSize), t.data(), tSize * sizeof(UChar)); 688 m_rep = Rep::create( pass(m_rep), 0, length);688 m_rep = Rep::create(m_rep, 0, length); 689 689 } else { 690 690 // this is shared with someone using more capacity, gotta make a whole new string … … 727 727 for (int i = 0; i < tSize; ++i) 728 728 d[thisSize+i] = t[i]; 729 m_rep = Rep::create( pass(m_rep), 0, length);729 m_rep = Rep::create(m_rep, 0, length); 730 730 } else { 731 731 // this is shared with someone using more capacity, gotta make a whole new string … … 767 767 UChar *d = const_cast<UChar *>(data()); 768 768 d[length] = c; 769 m_rep = Rep::create( pass(m_rep), 0, length + 1);769 m_rep = Rep::create(m_rep, 0, length + 1); 770 770 } else { 771 771 // this is shared with someone using more capacity, gotta make a whole new string … … 1123 1123 return *this; 1124 1124 1125 return UString(Rep::create( pass(m_rep), pos, len));1125 return UString(Rep::create(m_rep, pos, len)); 1126 1126 } 1127 1127
Note:
See TracChangeset
for help on using the changeset viewer.