Skip to content

Commit 1ae4750

Browse files
committed
Bug 1506730 - remove PLDHashTable::Iterator::mStart; r=njn
We only use its value in one place, and said value is easily computable from readily available information. This change makes iterators slightly smaller.
1 parent 2589f25 commit 1ae4750

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

xpcom/ds/PLDHashTable.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,6 @@ PLDHashTable::ShallowSizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
723723

724724
PLDHashTable::Iterator::Iterator(Iterator&& aOther)
725725
: mTable(aOther.mTable)
726-
, mStart(aOther.mStart)
727726
, mLimit(aOther.mLimit)
728727
, mCurrent(aOther.mCurrent)
729728
, mNexts(aOther.mNexts)
@@ -732,7 +731,6 @@ PLDHashTable::Iterator::Iterator(Iterator&& aOther)
732731
{
733732
// No need to change |mChecker| here.
734733
aOther.mTable = nullptr;
735-
aOther.mStart = nullptr;
736734
aOther.mLimit = nullptr;
737735
aOther.mCurrent = nullptr;
738736
aOther.mNexts = 0;
@@ -742,7 +740,6 @@ PLDHashTable::Iterator::Iterator(Iterator&& aOther)
742740

743741
PLDHashTable::Iterator::Iterator(PLDHashTable* aTable)
744742
: mTable(aTable)
745-
, mStart(mTable->mEntryStore.Get())
746743
, mLimit(mTable->mEntryStore.Get() + mTable->Capacity() * mTable->mEntrySize)
747744
, mCurrent(mTable->mEntryStore.Get())
748745
, mNexts(0)
@@ -793,7 +790,7 @@ PLDHashTable::Iterator::MoveToNextEntry()
793790
{
794791
mCurrent += mTable->mEntrySize;
795792
if (mCurrent == mLimit) {
796-
mCurrent = mStart; // Wrap-around. Possible due to Chaos Mode.
793+
mCurrent = mTable->mEntryStore.Get(); // Wrap-around. Possible due to Chaos Mode.
797794
}
798795
}
799796

xpcom/ds/PLDHashTable.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,6 @@ class PLDHashTable
485485
PLDHashTable* mTable; // Main table pointer.
486486

487487
private:
488-
char* mStart; // The first entry.
489488
char* mLimit; // One past the last entry.
490489
char* mCurrent; // Pointer to the current entry.
491490
uint32_t mNexts; // Number of Next() calls.

0 commit comments

Comments
 (0)