Replaced undefined check with the type check

This commit is contained in:
KoloMl 2025-02-12 21:30:06 +04:00
parent 235d7ab362
commit 5da1080ed9

View file

@ -24,7 +24,7 @@ export class UniqueHeap<T> {
const key = this.unique(value);
const prevIndex = this.keys.get(key);
if (prevIndex === undefined) {
if (typeof prevIndex === 'undefined') {
this.keys.set(key, this.length);
this.values[this.length++] = value;
} else if (forceReplace) {