From 5140380779025fdf3e6509a193d13a425f697a1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Belin?= Date: Thu, 25 Jul 2024 11:34:44 +0200 Subject: [PATCH] Code optimization --- src/finder.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/finder.ts b/src/finder.ts index 3328608..ec683d4 100644 --- a/src/finder.ts +++ b/src/finder.ts @@ -108,7 +108,7 @@ export class Finder { * @returns The paths of the executables found. */ async *#findExecutables(directory: string, command: string): AsyncGenerator { - for (const extension of ["", ...Finder.isWindows ? this.extensions : []]) { + for (const extension of ["", ...Finder.isWindows ? this.extensions : new Set]) { const resolvedPath = resolve(directory, `${command}${extension}`); if (await this.isExecutable(resolvedPath)) yield resolvedPath; }