mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-16 13:56:29 +00:00
Bug 753479 - Make HashTable::Enum::rekeyFront take a separate Lookup; r=luke
--HG-- extra : rebase_source : 7f8b2cda64f34c60f702182f64e370a73a593934
This commit is contained in:
parent
c7b184c24f
commit
6478881af8
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user