From 5e3bbef051db374abf20c4834be61a997d43ffcd Mon Sep 17 00:00:00 2001 From: Orca Worker Date: Fri, 11 Sep 2026 23:20:46 -0700 Subject: [PATCH] perf: fast-path Windows arguments without escapes --- src/shared/child-process/windows-command-line.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/shared/child-process/windows-command-line.ts b/src/shared/child-process/windows-command-line.ts index 401141e36c7..e3402f93c19 100644 --- a/src/shared/child-process/windows-command-line.ts +++ b/src/shared/child-process/windows-command-line.ts @@ -32,6 +32,9 @@ * because that part `CommandLineToArgvW` does interpret. */ function quoteWindows(value: string, escapePercent: boolean): string { + if (!(escapePercent ? /[\\"%]/ : /[\\"]/).test(value)) { + return `"${value}"` + } let quoted = '"' let backslashes = 0 for (const char of value) {