AST: HashMap inserts should overwrite existing keys

This commit is contained in:
Riyyi
2023-04-17 14:13:35 +02:00
parent 6980d28b36
commit e09f168d4f
+2 -2
View File
@@ -58,7 +58,7 @@ void HashMap::add(const std::string& key, ValuePtr value)
return; return;
} }
m_elements.emplace(key, value); m_elements.insert_or_assign(key, value);
} }
void HashMap::add(ValuePtr key, ValuePtr value) void HashMap::add(ValuePtr key, ValuePtr value)
@@ -67,7 +67,7 @@ void HashMap::add(ValuePtr key, ValuePtr value)
return; return;
} }
m_elements.emplace(getKeyString(key), value); m_elements.insert_or_assign(getKeyString(key), value);
} }
void HashMap::remove(const std::string& key) void HashMap::remove(const std::string& key)