mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-18 06:30:14 +08:00
Merge pull request #867 from stweil/fix
genericvector: Fix minimum size
This commit is contained in:
commit
926a066d77
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user