Make more use of llvm STLExtras (#4668)

This is essentially the result of looking at `.begin()` uses. We also
frequently do `std::shuffle`, but unfortunately STLExtras doesn't
provide a wrapper for that.
This commit is contained in:
Jon Ross-Perkins
2024-12-11 18:16:38 +00:00
committed by GitHub
parent 47285b6207
commit 61c0a8b676
15 changed files with 52 additions and 64 deletions
+4 -4
View File
@@ -349,10 +349,10 @@ auto DumpHashStatistics(llvm::ArrayRef<T> keys) -> void {
grouped_key_indices[hash_index].push_back(i);
}
ssize_t max_group_index =
std::max_element(grouped_key_indices.begin(), grouped_key_indices.end(),
[](const auto& lhs, const auto& rhs) {
return lhs.size() < rhs.size();
}) -
llvm::max_element(grouped_key_indices,
[](const auto& lhs, const auto& rhs) {
return lhs.size() < rhs.size();
}) -
grouped_key_indices.begin();
// If the max number of collisions on the index is less than or equal to the