BAN: Fix HashMap::{insert,emplace}_or_assign to actually assing value

I seemed to completely forgotten to do the assignment itself :D
This commit is contained in:
Bananymous 2024-11-04 15:42:04 +02:00
parent 1838ea5c30
commit a82f00cb70
1 changed files with 5 additions and 0 deletions

View File

@ -153,8 +153,13 @@ namespace BAN
return emplace(move(key), forward<Args>(args)...);
auto& bucket = get_bucket(key);
for (Entry& entry : bucket)
{
if (entry.key == key)
{
entry.value = T(forward<Args>(args)...);
return {};
}
}
TRY(bucket.emplace_back(move(key), forward<Args>(args)...));
m_size++;
return {};