mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 23:38:38 +09:00
Bug 1452202 - Clean up PLDHashTable move operator. r=froydnj, a=RyanVM
--HG-- extra : source : 9036c64b7a66ffe93e717ca97642a4400e396d9c extra : intermediate-source : 041d1c561feb5f4d9bcd492f31f7203ca477f938
This commit is contained in:
parent
72c04aea04
commit
ec18bcca97
1 changed files with 5 additions and 5 deletions
|
|
@ -216,17 +216,17 @@ PLDHashTable::operator=(PLDHashTable&& aOther)
|
|||
return *this;
|
||||
}
|
||||
|
||||
// Destruct |this|.
|
||||
this->~PLDHashTable();
|
||||
|
||||
// |mOps| and |mEntrySize| are const so we can't assign them. Instead, we
|
||||
// require that they are equal. The justification for this is that they're
|
||||
// |mOps| and |mEntrySize| are required to stay the same, they're
|
||||
// conceptually part of the type -- indeed, if PLDHashTable was a templated
|
||||
// type like nsTHashtable, they *would* be part of the type -- so it only
|
||||
// makes sense to assign in cases where they match.
|
||||
MOZ_RELEASE_ASSERT(mOps == aOther.mOps);
|
||||
MOZ_RELEASE_ASSERT(mEntrySize == aOther.mEntrySize);
|
||||
|
||||
// Reconstruct |this|.
|
||||
this->~PLDHashTable();
|
||||
new (KnownNotNull, this) PLDHashTable(aOther.mOps, aOther.mEntrySize, 0);
|
||||
|
||||
// Move non-const pieces over.
|
||||
mHashShift = Move(aOther.mHashShift);
|
||||
mEntryCount = Move(aOther.mEntryCount);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue