Make HashMap::put overwrite (r=jorendorff)

This commit is contained in:
Luke Wagner 2010-02-17 10:47:26 -08:00
parent dd646b8dc5
commit fc7cbdfdc8

View File

@ -806,7 +806,11 @@ class HashMap
Entry *put(const Key &k, const Value &v) {
AddPtr p = lookupForAdd(k);
return p ? &*p : (add(p, k, v) ? &*p : NULL);
if (p) {
p->value = v;
return &*p;
}
return add(p, k, v) ? &*p : NULL;
}
void remove(const Lookup &l) {