Skip to content

Commit

Permalink
fix: use for of instead of forEach at release method in NexoMap
Browse files Browse the repository at this point in the history
  • Loading branch information
drusco committed Sep 3, 2024
1 parent fcac564 commit 7335735
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/NexoMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ class NexoMap<Target extends nx.traceable> extends Map<

this._release = true;

this.forEach((weakRef, key) => {
for (const [key, weakRef] of this) {
if (weakRef.deref() === undefined) {
this.releaseKey = key;
this.delete(key);
this.releaseKey = undefined;
delete this.releaseKey;
}
});
}

const event = new NexoEvent("release", { target: this });
this.events.emit(event.name, event);
Expand Down

0 comments on commit 7335735

Please sign in to comment.