mirror of
https://github.com/stablyai/orca.git
synced 2026-09-26 16:02:43 +00:00
perf: fast-path Windows arguments without escapes
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user