Changeset 55035 in webkit for trunk/JavaScriptCore/runtime/UStringImpl.cpp
- Timestamp:
- Feb 19, 2010, 3:36:09 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/UStringImpl.cpp
r54843 r55035 150 150 } 151 151 152 PassRefPtr<UStringImpl> singleCharacterSubstring(UStringOrRopeImpl* impl, unsigned index) 153 { 154 top: 155 if (impl->isRope()) { 156 URopeImpl* rope = static_cast<URopeImpl*>(impl); 157 for (unsigned i = 0; i < rope->m_fiberCount; ++i) { 158 UStringOrRopeImpl* currentFiber = rope->fibers(i); 159 unsigned fiberLength = currentFiber->length(); 160 if (index < fiberLength) { 161 impl = currentFiber; 162 goto top; 163 } 164 index -= fiberLength; 165 } 166 CRASH(); 167 } 168 169 return static_cast<UStringImpl*>(impl)->singleCharacterSubstring(index); 170 } 171 152 172 } // namespace JSC
Note:
See TracChangeset
for help on using the changeset viewer.