Fix silly crash in HashMap::remove(). r=graydon on IRC, no bug.

--HG--
extra : rebase_source : 25d53309e30bec26f7a93148c9000e1c79431986
This commit is contained in:
Jason Orendorff 2009-08-21 15:14:37 -05:00
parent c78334cec0
commit f9a7d4274f

View File

@ -316,7 +316,7 @@ namespace nanojit
/** remove k from the map, if it is present. if not, remove()
* silently returns */
void remove(const K& k) {
size_t i = H::hash(k);
size_t i = H::hash(k) % nbuckets;
Seq<Node>** prev = &buckets[i];
for (Seq<Node>* p = buckets[i]; p != NULL; p = p->tail) {
if (p->head.key == k) {