Fixed DualKeyMap MultiQuery not recording how many found properly

This commit is contained in:
2026-03-02 18:20:11 +02:00
parent cecea2eaff
commit 30cbc7cd1c
2 changed files with 32 additions and 14 deletions

View File

@@ -100,6 +100,25 @@ public:
"Hashmap", Systems::Logging::LogLevel::Error);
}
[[nodiscard("Discarding an expensive operation!")]]
std::vector<Value> ExtractValuesToArray() {
std::vector<Value> result;
result.reserve(count);
for (bucket &entry : storage) {
for (hashStorage &hash : entry) {
result.emplace_back(std::move(hash.value));
}
entry.clear();
}
count = 0;
bucketCount = minimumBucketCount;
std::vector<bucket> newStorage;
storage.swap(newStorage);
return result;
}
void Clear() noexcept {
storage.clear();
count = 0;