From a82f00cb70cbd4aed76482686ed8fb1e2eabd21c Mon Sep 17 00:00:00 2001 From: Bananymous Date: Mon, 4 Nov 2024 15:42:04 +0200 Subject: [PATCH] BAN: Fix HashMap::{insert,emplace}_or_assign to actually assing value I seemed to completely forgotten to do the assignment itself :D --- BAN/include/BAN/HashMap.h | 5 +++++ 1 file changed, 5 insertions(+) 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 {};