Make set -add replace existing value when applied to a map option

This commit is contained in:
Maxime Coste 2018-03-30 09:26:39 +11:00
parent 436e803e30
commit f6f2dafaf7

View File

@ -142,7 +142,7 @@ bool option_add(HashMap<Key, Value, domain>& opt, StringView str)
HashItem<Key, Value> item; HashItem<Key, Value> item;
option_from_string(key_value[0], item.key); option_from_string(key_value[0], item.key);
option_from_string(key_value[1], item.value); option_from_string(key_value[1], item.value);
opt.insert(std::move(item)); opt[std::move(item.key)] = std::move(item.value);
changed = true; changed = true;
} }
return changed; return changed;