Merge pull request #867 from stweil/fix

genericvector: Fix minimum size
This commit is contained in:
zdenop 2017-05-03 12:46:33 +02:00 committed by GitHub
commit 926a066d77

View File

@ -658,6 +658,7 @@ template <typename T>
void GenericVector<T>::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];