Merge m-c to a CLOSED TREE f-t

This commit is contained in:
Phil Ringnalda 2015-06-11 21:36:02 -07:00
commit 01053f6349
2 changed files with 2 additions and 1 deletions

View File

@ -81,6 +81,7 @@ public:
*/
static uint32_t randomUint32LessThan(uint32_t aBound)
{
MOZ_ASSERT(aBound != 0);
return uint32_t(rand()) % aBound;
}
};

View File

@ -910,7 +910,7 @@ PLDHashTable::Iterator::Iterator(const PLDHashTable* aTable)
// mEntryAddr, respectively.
uint32_t capacity = mTable->Capacity();
if (ChaosMode::isActive(ChaosMode::HashTableIteration)) {
if (ChaosMode::isActive(ChaosMode::HashTableIteration) && capacity > 0) {
// Start iterating at a random point in the hashtable. It would be
// even more chaotic to iterate in fully random order, but that's a lot
// more work.