Fixed code review issues

This commit is contained in:
Maksim Kita 2024-01-30 19:36:40 +03:00
parent 948f3f1f62
commit 1c5b377b3a
2 changed files with 9 additions and 3 deletions

View File

@ -132,9 +132,15 @@ struct GroupArraySortedData
ALWAYS_INLINE void sortAndLimit(size_t max_elements, Arena * arena)
{
if constexpr (is_value_generic_field)
{
::sort(values.begin(), values.end(), Comparator());
}
else
RadixSort<RadixSortNumTraits<T>>::executeLSD(values.data(), values.size());
{
bool is_sorted = trySort(values.begin(), values.end(), Comparator());
if (!is_sorted)
RadixSort<RadixSortNumTraits<T>>::executeLSD(values.data(), values.size());
}
if (values.size() > max_elements)
values.resize(max_elements, arena);

View File

@ -182,8 +182,8 @@ int main(int argc, char ** argv)
}
std::string method = std::string(argv[1]);
uint64_t elements = std::atol(argv[2]);
uint64_t max_elements = std::atol(argv[3]);
uint64_t elements = std::atol(argv[2]); /// NOLINT
uint64_t max_elements = std::atol(argv[3]); /// NOLINT
std::cerr << "Method " << method << " elements " << elements << " max elements " << max_elements << '\n';