perf(go): batch literal text in quoted build settings (#12238)

This commit is contained in:
ShuaixinHuang authored and GitHub committed 2026-11-19 06:35:02 -05:00
1 parent fedf33eb59
commit e36bcfec67
2 files changed
+12 -6

No files matched your search

+10 -4
View File
@@ -38,10 +38,16 @@ const quoted = (input: string): { value: string; end: number } | null => {
}
if (character === "\n") return null;
if (character !== "\\") {
const point = input.codePointAt(index);
if (point === undefined) return null;
length += output.write(String.fromCodePoint(point), length, "utf8");
index += point > 0xffff ? 2 : 1;
const start = index;
do {
index += 1;
} while (
index < input.length &&
input[index] !== '"' &&
input[index] !== "\n" &&
input[index] !== "\\"
);
length += output.write(input.slice(start, index), length, "utf8");
continue;
}
const escaped = input[index + 1];