mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 00:22:29 +00:00
Resize underlying vector only pos_offset == vector.size()
This commit is contained in:
parent
07a6e49941
commit
db806bd394
@ -86,7 +86,10 @@ private:
|
||||
size_t old_size = vector.size();
|
||||
/// pos may not be equal to vector.data() + old_size, because WriteBuffer::next() can be used to flush data
|
||||
size_t pos_offset = pos - reinterpret_cast<Position>(vector.data());
|
||||
if (pos_offset == vector.size())
|
||||
{
|
||||
vector.resize(old_size * size_multiplier);
|
||||
}
|
||||
internal_buffer = Buffer(reinterpret_cast<Position>(vector.data() + pos_offset), reinterpret_cast<Position>(vector.data() + vector.size()));
|
||||
working_buffer = internal_buffer;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user