refactor: KeyWeakMap cleanup (#41242)
* refactor: make KeyWeakMap::KeyObject private * perf: avoid redundant map lookup * refactor: remove unused KeyWeakMap::Has() * refactor: make KeyWeakMap dtor nonvirtual no inheritance used, so no need for virtual dtor? * chore: fix KeyWeakMap code comment * refactor: use if statement in KeyWeakMap::Get() * refactor: use better variable names in KeyWeakMap::Values()
This commit is contained in:
parent
768ece6b54
commit
5686f88bd2
2 changed files with 16 additions and 21 deletions
|
@ -107,7 +107,7 @@ class TrackableObject : public TrackableObjectBase, public EventEmitter<T> {
|
|||
|
||||
// Removes this instance from the weak map.
|
||||
void RemoveFromWeakMap() {
|
||||
if (weak_map_ && weak_map_->Has(weak_map_id()))
|
||||
if (weak_map_)
|
||||
weak_map_->Remove(weak_map_id());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue