Fix ugly ugliness

This commit is contained in:
Alexey Milovidov 2020-07-08 04:56:50 +03:00
parent abf1e015b3
commit 34e67b521a

View File

@ -50,11 +50,11 @@ struct ArrayFillImpl
for (auto in_offset : in_offsets)
{
array_end = in_offset - 1;
array_end = in_offset;
for (; end <= array_end; ++end)
for (; end < array_end; ++end)
{
if (end == array_end || fill[end + 1] != fill[begin])
if (end + 1 == array_end || fill[end + 1] != fill[begin])
{
if (fill[begin])
out_data.insertRangeFrom(in_data, begin, end + 1 - begin);
@ -62,8 +62,8 @@ struct ArrayFillImpl
{
if constexpr (reverse)
{
if (end == array_end)
out_data.insertManyFrom(in_data, array_end, end + 1 - begin);
if (end + 1 == array_end)
out_data.insertManyFrom(in_data, end, end + 1 - begin);
else
out_data.insertManyFrom(in_data, end + 1, end + 1 - begin);
}
@ -80,7 +80,7 @@ struct ArrayFillImpl
}
}
array_begin = array_end + 1;
array_begin = array_end;
}
}
else
@ -93,8 +93,7 @@ struct ArrayFillImpl
if (column_fill_const->getValue<UInt8>())
return ColumnArray::create(
array.getDataPtr(),
array.getOffsetsPtr()
);
array.getOffsetsPtr());
size_t array_begin = 0;
size_t array_end = 0;