Fix clang-tidy

This commit is contained in:
Kseniia Sumarokova 2024-07-02 11:54:56 +02:00 committed by GitHub
parent 5e7a8245c4
commit a905b24f75
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -125,7 +125,7 @@ void Chunk::addColumn(size_t position, ColumnPtr column)
if (position >= columns.size())
throw Exception(ErrorCodes::POSITION_OUT_OF_BOUND,
"Position {} out of bound in Chunk::addColumn(), max position = {}",
position, columns.size() ? columns.size() - 1 : 0);
position, !columns.empty() ? columns.size() - 1 : 0);
if (empty())
num_rows = column->size();
else if (column->size() != num_rows)
@ -143,7 +143,7 @@ void Chunk::erase(size_t position)
if (position >= columns.size())
throw Exception(ErrorCodes::POSITION_OUT_OF_BOUND, "Position {} out of bound in Chunk::erase(), max position = {}",
toString(position), toString(columns.size() ? columns.size() - 1 : 0));
toString(position), toString(!columns.empty() ? columns.size() - 1 : 0));
columns.erase(columns.begin() + position);
}