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:
parent
1838ea5c30
commit
a82f00cb70
|
@ -153,8 +153,13 @@ namespace BAN
|
||||||
return emplace(move(key), forward<Args>(args)...);
|
return emplace(move(key), forward<Args>(args)...);
|
||||||
auto& bucket = get_bucket(key);
|
auto& bucket = get_bucket(key);
|
||||||
for (Entry& entry : bucket)
|
for (Entry& entry : bucket)
|
||||||
|
{
|
||||||
if (entry.key == key)
|
if (entry.key == key)
|
||||||
|
{
|
||||||
|
entry.value = T(forward<Args>(args)...);
|
||||||
return {};
|
return {};
|
||||||
|
}
|
||||||
|
}
|
||||||
TRY(bucket.emplace_back(move(key), forward<Args>(args)...));
|
TRY(bucket.emplace_back(move(key), forward<Args>(args)...));
|
||||||
m_size++;
|
m_size++;
|
||||||
return {};
|
return {};
|
||||||
|
|
Loading…
Reference in New Issue