From eb2e59ca5ef0ccab2a3fe74368087b7e38f8e60c Mon Sep 17 00:00:00 2001 From: neverland Date: Wed, 5 Aug 2026 21:23:12 +0800 Subject: [PATCH] perf(fmt): avoid duplicate binary path checks --- packages/rstack/src/fmt/discoverPaths.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/rstack/src/fmt/discoverPaths.ts b/packages/rstack/src/fmt/discoverPaths.ts index 1b587bb..278f244 100644 --- a/packages/rstack/src/fmt/discoverPaths.ts +++ b/packages/rstack/src/fmt/discoverPaths.ts @@ -296,7 +296,7 @@ const classifyPatterns = async ( const stats = await lstatSafe(filePath); if (stats?.isFile()) { - return { kind: 'file', value: filePath }; + return isBinaryPath(filePath) ? undefined : { kind: 'file', value: filePath }; } if (stats?.isDirectory()) { return { kind: 'directory', value: filePath }; @@ -436,10 +436,6 @@ const discoverFmtPaths = async ({ const filePaths: string[] = []; for (const filePath of candidates) { - if (isBinaryPath(filePath)) { - continue; - } - if (negativeGlobMatchers.length) { const relativePath = toPosixPath(path.relative(cwd, filePath)); if (negativeGlobMatchers.some((matches) => matches(relativePath))) {