This commit is contained in:
dwitte@stanford.edu 2007-12-20 01:33:03 -08:00
Родитель 95bff28af3
Коммит 2be9e23043
1 изменённых файлов: 4 добавлений и 9 удалений

Просмотреть файл

@ -83,15 +83,10 @@ nsTArray_base::EnsureCapacity(size_type capacity, size_type elemSize) {
// Use doubling algorithm when forced to increase available capacity.
NS_ASSERTION(mHdr->mCapacity > 0, "should not have buffer of zero size");
if (capacity < 8) {
// grow to 8 elements
capacity = 8;
} else {
size_type temp = mHdr->mCapacity;
while (temp < capacity)
temp <<= 1;
capacity = temp;
}
size_type temp = mHdr->mCapacity;
while (temp < capacity)
temp <<= 1;
capacity = temp;
Header *header;
if (UsesAutoArrayBuffer()) {