зеркало из https://github.com/mozilla/pjs.git
Bug 411061 nsAutoTArray uses an inefficient first-time allocation strategy r=bsmedberg a=schrep
This commit is contained in:
Родитель
0998c7390f
Коммит
3699446778
|
@ -82,11 +82,7 @@ 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");
|
||||
size_type temp = mHdr->mCapacity;
|
||||
while (temp < capacity)
|
||||
temp <<= 1;
|
||||
capacity = temp;
|
||||
capacity = PR_MAX(capacity, mHdr->mCapacity << 1);
|
||||
|
||||
Header *header;
|
||||
if (UsesAutoArrayBuffer()) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче