Bug 753479 - Make HashTable::Enum::rekeyFront take a separate Lookup; r=luke

--HG--
extra : rebase_source : 7f8b2cda64f34c60f702182f64e370a73a593934
This commit is contained in:
Terrence Cole 2012-05-04 14:18:28 -07:00
parent c7b184c24f
commit 6478881af8

View File

@ -247,17 +247,21 @@ class HashTable : private AllocPolicy
* a new key at the new Lookup position. |front()| is invalid after
* this operation until the next call to |popFront()|.
*/
void rekeyFront(const Key &k) {
void rekeyFront(const Lookup &l, const Key &k) {
JS_ASSERT(&k != &HashPolicy::getKey(this->cur->t));
if (table.match(*this->cur, k))
if (match(*this->cur, l))
return;
Entry e = *this->cur;
HashPolicy::setKey(e.t, const_cast<Key &>(k));
table.remove(*this->cur);
table.add(k, e);
table.add(l, e);
added = true;
}
void rekeyFront(const Key &k) {
rekeyFront(k, k);
}
/* Potentially rehashes the table. */
~Enum() {
if (added)