From 74f7ee8e77491099f128ab271c93d082a791029c Mon Sep 17 00:00:00 2001 From: Dev Date: Mon, 7 Aug 2023 11:17:46 +0100 Subject: [PATCH] Rework usage of filter() into some() --- project/src/services/ProfileFixerService.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/project/src/services/ProfileFixerService.ts b/project/src/services/ProfileFixerService.ts index ec0651eb..30b9ad90 100644 --- a/project/src/services/ProfileFixerService.ts +++ b/project/src/services/ProfileFixerService.ts @@ -220,11 +220,11 @@ export class ProfileFixerService { if (pmcProfile.RepeatableQuests && activeQuests.length > 0) { - const matchingQuest = activeQuests.filter(x => x._id === backendCounter.qid); - const quest = pmcProfile.Quests.filter(q => q.qid === backendCounter.qid); + const existsInActiveRepeatableQuests = activeQuests.some(x => x._id === backendCounter.qid); + const existsInQuests = pmcProfile.Quests.some(q => q.qid === backendCounter.qid); // if BackendCounter's quest is neither in activeQuests nor Quests it's stale - if (matchingQuest.length === 0 && quest.length === 0) + if (existsInActiveRepeatableQuests && existsInQuests) { counterKeysToRemove.push(key); }