Skip to content

Commit

Permalink
Code optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
cedx committed Jul 25, 2024
1 parent 8643965 commit 5140380
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/finder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class Finder {
* @returns The paths of the executables found.
*/
async *#findExecutables(directory: string, command: string): AsyncGenerator<string, void> {
for (const extension of ["", ...Finder.isWindows ? this.extensions : []]) {
for (const extension of ["", ...Finder.isWindows ? this.extensions : new Set<string>]) {
const resolvedPath = resolve(directory, `${command}${extension}`);
if (await this.isExecutable(resolvedPath)) yield resolvedPath;
}
Expand Down

0 comments on commit 5140380

Please sign in to comment.