mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-23 10:10:50 +00:00
dbms: add PODArray::resize_fill(size_t, const T&)
This commit is contained in:
parent
e982b5c92d
commit
070c6be60e
@ -231,6 +231,17 @@ public:
|
||||
c_end = c_start + byte_size(n);
|
||||
}
|
||||
|
||||
void resize_fill(size_t n, const T & value)
|
||||
{
|
||||
size_t old_size = size();
|
||||
if (n > old_size)
|
||||
{
|
||||
reserve(n);
|
||||
std::fill(t_end(), reinterpret_cast<T *>(c_end + n - old_size), value);
|
||||
}
|
||||
c_end = c_start + byte_size(n);
|
||||
}
|
||||
|
||||
void clear()
|
||||
{
|
||||
c_end = c_start;
|
||||
|
Loading…
Reference in New Issue
Block a user