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