This commit is contained in:
Alexey Milovidov 2019-07-28 20:16:48 +03:00
parent ea6515dac6
commit f03df37b57

View File

@ -57,7 +57,7 @@ public:
: WriteBuffer(nullptr, 0), vector(vector_)
{
size_t old_size = vector.size();
vector.resize(vector.capacity() < initial_size ? initial_size : vector.capacity());
vector.resize(std::max(vector.size() + initial_size, vector.capacity()));
set(reinterpret_cast<Position>(vector.data() + old_size), (vector.size() - old_size) * sizeof(typename VectorType::value_type));
}