From c2a52d3c180c9ade28fbf1f63ab27773295e32ac Mon Sep 17 00:00:00 2001 From: JackEnx <167036558+JackEnx@users.noreply.github.com> Date: Mon, 16 Dec 2024 16:35:12 -0300 Subject: [PATCH] refactor: reduce code redundance --- src/main/services/process-watcher.ts | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/main/services/process-watcher.ts b/src/main/services/process-watcher.ts index 9a99cbe2..573b4feb 100644 --- a/src/main/services/process-watcher.ts +++ b/src/main/services/process-watcher.ts @@ -43,17 +43,9 @@ const gamesIdWithoutPath = async () => { }, }); - const gameExecutableIds: string[] = []; - - for (const game of games) { - const has = gameExecutables[game.objectID]; - - if (has) { - gameExecutableIds.push(game.objectID); - } - } - - return gameExecutableIds; + return games + .filter((game) => gameExecutables[game.objectID]) + .map((game) => game.objectID); }; const findGamePathByProcess = (