refactor: Set descontruction to Set foreach

This commit is contained in:
JackEnx 2024-12-16 18:39:14 -03:00
parent 1ffb9828f7
commit 431ad2ff2c

View File

@ -63,19 +63,19 @@ const findGamePathByProcess = (
if (!exe) continue; if (!exe) continue;
const hasProcess = processMap.get(exe); const pathSet = processMap.get(exe);
if (hasProcess) { if (pathSet) {
const executableName = executable.name.replace(/\//g, "\\"); const executableName = executable.name.replace(/\//g, "\\");
for (const path of [...hasProcess]) { pathSet.forEach((path) => {
if (path.toLowerCase().endsWith(executableName)) { if (path.toLowerCase().endsWith(executableName)) {
gameRepository.update( gameRepository.update(
{ objectID: id, shop: "steam" }, { objectID: id, shop: "steam" },
{ executablePath: path } { executablePath: path }
); );
} }
} });
} }
} }
} }