Optimize positions vector allocation with reserve()

Co-authored-by: jll63 <5083077+jll63@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-18 04:56:37 +00:00
parent fe45caf13c
commit b486642748
2 changed files with 2 additions and 0 deletions

View File

@@ -0,0 +1 @@
.

View File

@@ -313,6 +313,7 @@ void minimal_perfect_hash::fn<Registry>::initialize(
// Check if this displacement works for all keys in group
std::vector<std::size_t> positions;
positions.reserve(groups[g].size());
bool valid = true;
for (auto key : groups[g]) {
auto pilot = (mult * reinterpret_cast<detail::uintptr>(key)) >> shift;