File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -697,20 +697,15 @@ PLDHashTable::EntryHandle::EntryHandle(EntryHandle&& aOther) noexcept
697
697
mKeyHash (aOther.mKeyHash ),
698
698
mSlot (aOther.mSlot ) {}
699
699
700
+ #ifdef MOZ_HASH_TABLE_CHECKS_ENABLED
700
701
PLDHashTable::EntryHandle::~EntryHandle () {
701
702
if (!mTable ) {
702
703
return ;
703
704
}
704
705
705
- // If our slot is empty when this `EntryHandle` is destroyed, we may want to
706
- // resize our table, as we just removed an entry.
707
- if (!HasEntry ()) {
708
- mTable ->ShrinkIfAppropriate ();
709
- }
710
- #ifdef MOZ_HASH_TABLE_CHECKS_ENABLED
711
706
mTable ->mChecker .EndWriteOp ();
712
- #endif
713
707
}
708
+ #endif
714
709
715
710
void PLDHashTable::EntryHandle::Remove () {
716
711
MOZ_ASSERT (HasEntry ());
Original file line number Diff line number Diff line change @@ -532,7 +532,9 @@ class PLDHashTable {
532
532
class EntryHandle {
533
533
public:
534
534
EntryHandle (EntryHandle&& aOther) noexcept ;
535
+ #ifdef MOZ_HASH_TABLE_CHECKS_ENABLED
535
536
~EntryHandle ();
537
+ #endif
536
538
537
539
EntryHandle (const EntryHandle&) = delete ;
538
540
EntryHandle& operator =(const EntryHandle&) = delete ;
@@ -568,8 +570,19 @@ class PLDHashTable {
568
570
return Entry ();
569
571
}
570
572
573
+ /* * Removes the entry. Note that the table won't shrink on destruction of
574
+ * the EntryHandle.
575
+ *
576
+ * \pre HasEntry()
577
+ * \post !HasEntry()
578
+ */
571
579
void Remove ();
572
580
581
+ /* * Removes the entry, if it exists. Note that the table won't shrink on
582
+ * destruction of the EntryHandle.
583
+ *
584
+ * \post !HasEntry()
585
+ */
573
586
void OrRemove ();
574
587
575
588
private:
You can’t perform that action at this time.
0 commit comments