diff --git a/BAN/include/BAN/HashMap.h b/BAN/include/BAN/HashMap.h index 1c6d2c58..9c47d526 100644 --- a/BAN/include/BAN/HashMap.h +++ b/BAN/include/BAN/HashMap.h @@ -153,8 +153,13 @@ namespace BAN return emplace(move(key), forward(args)...); auto& bucket = get_bucket(key); for (Entry& entry : bucket) + { if (entry.key == key) + { + entry.value = T(forward(args)...); return {}; + } + } TRY(bucket.emplace_back(move(key), forward(args)...)); m_size++; return {};