diff --git a/ccutil/genericvector.h b/ccutil/genericvector.h index dfc70f1afa..4dee34d178 100644 --- a/ccutil/genericvector.h +++ b/ccutil/genericvector.h @@ -658,6 +658,7 @@ template void GenericVector::reserve(int size) { if (size_reserved_ >= size || size <= 0) return; + if (size < kDefaultVectorSize) size = kDefaultVectorSize; T* new_array = new T[size]; for (int i = 0; i < size_used_; ++i) new_array[i] = data_[i];