From e09f168d4ffb646ef33a1cdb25c4b8e0d6b388df Mon Sep 17 00:00:00 2001 From: Riyyi Date: Mon, 17 Apr 2023 14:13:35 +0200 Subject: [PATCH] AST: HashMap inserts should overwrite existing keys --- src/ast.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ast.cpp b/src/ast.cpp index c951bae..56547ba 100644 --- a/src/ast.cpp +++ b/src/ast.cpp @@ -58,7 +58,7 @@ void HashMap::add(const std::string& key, ValuePtr value) return; } - m_elements.emplace(key, value); + m_elements.insert_or_assign(key, value); } void HashMap::add(ValuePtr key, ValuePtr value) @@ -67,7 +67,7 @@ void HashMap::add(ValuePtr key, ValuePtr value) return; } - m_elements.emplace(getKeyString(key), value); + m_elements.insert_or_assign(getKeyString(key), value); } void HashMap::remove(const std::string& key)