From db061e09666aa3b99b7d174bf9c29484e89ba980 Mon Sep 17 00:00:00 2001 From: Kirk McDonald Date: Tue, 15 Oct 2024 23:39:35 -0700 Subject: [PATCH] Eliminate Set.intersection call. --- factory.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/factory.js b/factory.js index ac984bc..94959bc 100644 --- a/factory.js +++ b/factory.js @@ -49,7 +49,12 @@ class BuildingSet { } } overlap(other) { - return this.categories.intersection(other.categories).size > 0 + for (let category of this.categories) { + if (other.categories.has(category)) { + return true + } + } + return false } }