Perf: avoid spread operator

This commit is contained in:
SukkaW
2024-06-26 17:49:32 +08:00
parent e7766281d0
commit 33636285e9
8 changed files with 69 additions and 56 deletions

View File

@@ -2,4 +2,4 @@ export const SHARED_DESCRIPTION = [
'License: AGPL 3.0',
'Homepage: https://ruleset.skk.moe',
'GitHub: https://github.com/SukkaW/Surge'
] as const;
];

View File

@@ -26,7 +26,7 @@ export async function compareAndWriteFile(span: Span, linesA: string[], filePath
let index = 0;
for await (const lineB of readFileByLine(file)) {
const lineA = linesA[index];
const lineA = linesA[index] as string | undefined;
index++;
if (lineA == null) {

View File

@@ -28,7 +28,7 @@ export class PolyfillTextDecoderStream extends TransformStream<Uint8Array, strin
) {
const decoder = new TextDecoder(encoding, { fatal, ignoreBOM });
const nonLastChunkDecoderOpt: TextDecodeOptions = { stream: true };
const nonLastChunkDecoderOpt = { stream: true };
super({
transform(chunk: Uint8Array, controller: TransformStreamDefaultController<string>) {