From 433f30175eedcab2e3e46cc8a9dde6af750eefed Mon Sep 17 00:00:00 2001 From: Jeremy Scheff Date: Thu, 30 Jan 2025 21:04:47 -0500 Subject: [PATCH] Set.difference is not actually used --- src/common/polyfills-modern.ts | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/common/polyfills-modern.ts b/src/common/polyfills-modern.ts index e1069ced5..fcd043c15 100644 --- a/src/common/polyfills-modern.ts +++ b/src/common/polyfills-modern.ts @@ -17,30 +17,6 @@ type SetReadOperations = { has(key: T): boolean; keys(): IterableIterator; }; -if (!Set.prototype.difference) { - Object.defineProperty(Set.prototype, "difference", { - value(this: Set, other: SetReadOperations): Set { - const result = new Set(this); - if (this.size <= other.size) { - for (const elem of this) { - if (other.has(elem)) { - result.delete(elem); - } - } - } else { - for (const elem of other.keys()) { - if (result.has(elem)) { - result.delete(elem); - } - } - } - return result; - }, - writable: true, - enumerable: false, - configurable: true, - }); -} if (!Set.prototype.isSubsetOf) { Object.defineProperty(Set.prototype, "isSubsetOf", { value(this: Set, other: SetReadOperations): boolean {