Bug 744052 - Restructure HashTable::checkOverflow for easier reading; r=luke

When I added this function, I just copied the existing logical structure.  It
makes more sense here to check overflowed and return early, since we can do this
now.
This commit is contained in:
Terrence Cole 2012-04-10 09:51:48 -07:00
parent 5ec5cf5d06
commit dfd9f312e5

View File

@ -619,7 +619,9 @@ class HashTable : private AllocPolicy
bool checkOverloaded()
{
if (overloaded()) {
if (!overloaded())
return false;
/* Compress if a quarter or more of all entries are removed. */
int deltaLog2;
if (removedCount >= (capacity() >> 2)) {
@ -633,9 +635,6 @@ class HashTable : private AllocPolicy
return changeTableSize(deltaLog2);
}
return false;
}
void remove(Entry &e)
{
METER(stats.removes++);