mirror of
https://github.com/morluto/rea.git
synced 2026-11-21 22:15:50 +00:00
perf(go): batch literal text in quoted build settings (#12238)
This commit is contained in:
1 parent
fedf33eb59
commit
e36bcfec67
2 files changed
+12
-6
No files matched your search
+10
-4
@@ -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];
|
||||
|
||||
Reference in new issue
Block a user