зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1641090, part 6 - Make ReplaceWithID compatible with nsTHashtable's Put. r=nika
This method is the same as Put(), except that it asserts that the item is not already present. It also puts the key second. Make it compatible by hoisting out the assert and reversing the arguments. We can use the definition of Put() defined in an earlier patch. Differential Revision: https://phabricator.services.mozilla.com/D77167
This commit is contained in:
Родитель
de620fecfb
Коммит
064fa8de6e
|
@ -47,11 +47,6 @@ class IDMap {
|
|||
}
|
||||
}
|
||||
|
||||
void ReplaceWithID(const T& data, int32_t id) {
|
||||
MOZ_ASSERT(Contains(id), "Only replace an existing ID");
|
||||
data_[id] = data;
|
||||
}
|
||||
|
||||
void Clear() { data_.clear(); }
|
||||
|
||||
T Lookup(int32_t id) const {
|
||||
|
|
|
@ -867,7 +867,8 @@ void IToplevelProtocol::ReplaceEventTargetForActor(
|
|||
MOZ_RELEASE_ASSERT(id != kNullActorId && id != kFreedActorId);
|
||||
|
||||
MutexAutoLock lock(mEventTargetMutex);
|
||||
mEventTargetMap.ReplaceWithID(aEventTarget, id);
|
||||
MOZ_ASSERT(mEventTargetMap.Contains(id), "Only replace an existing ID");
|
||||
mEventTargetMap.Put(id, aEventTarget);
|
||||
}
|
||||
|
||||
} // namespace ipc
|
||||
|
|
Загрузка…
Ссылка в новой задаче