From c52748734f8bacc73010b1761802edc1d534f20a Mon Sep 17 00:00:00 2001 From: cfngc4594 Date: Sat, 1 Mar 2025 23:22:15 +0800 Subject: [PATCH] fix(judge): replace 'let' with 'const' for variables that are never reassigned --- src/app/actions/judge.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/actions/judge.ts b/src/app/actions/judge.ts index a1f9b95..f959730 100644 --- a/src/app/actions/judge.ts +++ b/src/app/actions/judge.ts @@ -51,8 +51,8 @@ async function compileCode(container: Docker.Container, filePath: string, fileNa return reject(new Error("Stream is undefined")); } - let stdoutChunks: string[] = []; - let stderrChunks: string[] = []; + const stdoutChunks: string[] = []; + const stderrChunks: string[] = []; const stdoutStream = new Writable({ write(chunk, encoding, callback) { @@ -102,8 +102,8 @@ async function runCode(container: Docker.Container, fileName: string) { return reject(new Error("Stream is undefined")); } - let stdoutChunks: string[] = []; - let stderrChunks: string[] = []; + const stdoutChunks: string[] = []; + const stderrChunks: string[] = []; const stdoutStream = new Writable({ write(chunk, encoding, callback) {