Resorted to a minor correction in the for-loop

This commit is contained in:
Alexander Kazakov 2020-03-02 19:51:03 +03:00
parent dc4ae6435b
commit fa3e915e7f

View File

@ -348,13 +348,12 @@ ColumnPtr ColumnVector<T>::replicate(const IColumn::Offsets & offsets) const
auto res = this->create(offsets.back());
typename Self::Container::value_type * const start = res->getData().data();
typename Self::Container::value_type * curr = start;
auto it = res->getData().begin();
for (size_t i = 0; i < size; ++i)
{
const auto span_end = start + offsets[i];
while (curr < span_end)
*curr++ = data[i];
const auto span_end = res->getData().begin() + offsets[i];
for (; it != span_end; ++it)
*it = data[i];
}
return res;