Changeset 38285 in webkit for trunk/JavaScriptCore/wtf
- Timestamp:
- Nov 10, 2008, 7:51:24 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/wtf/Vector.h
r38173 r38285 280 280 void deallocateBuffer(T* bufferToDeallocate) 281 281 { 282 if (m_buffer == bufferToDeallocate) 282 if (m_buffer == bufferToDeallocate) { 283 283 m_buffer = 0; 284 m_capacity = 0; 285 } 284 286 fastFree(bufferToDeallocate); 285 287 } … … 443 445 ~Vector() 444 446 { 445 clear();447 if (m_size) shrink(0); 446 448 } 447 449 … … 494 496 void shrinkCapacity(size_t newCapacity); 495 497 496 void clear() { if (m_size) shrink(0); }498 void clear() { shrinkCapacity(0); } 497 499 498 500 template<typename U> void append(const U*, size_t); … … 726 728 return; 727 729 728 resize(min(m_size, newCapacity)); 730 if (newCapacity < size()) 731 shrink(newCapacity); 729 732 730 733 T* oldBuffer = begin();
Note:
See TracChangeset
for help on using the changeset viewer.