Skip to content

Commit a361e42

Browse files
committed
judge: compilerText: allow multiple files
1 parent 1586852 commit a361e42

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

packages/hydrojudge/src/utils.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,8 @@ export namespace Lock {
2727
}
2828
}
2929

30-
export function compilerText(stdout: string, stderr: string) {
31-
const ret = [];
32-
if (!EMPTY_STR.test(stdout)) ret.push(stdout.substring(0, 1024 * 1024));
33-
if (!EMPTY_STR.test(stderr)) ret.push(stderr.substring(0, 1024 * 1024));
34-
return ret.join('\n');
30+
export function compilerText(...messages: string[]) {
31+
return messages.filter((i) => !EMPTY_STR.test(i)).map((i) => i.substring(0, 1024 * 1024)).join('\n');
3532
}
3633

3734
function restrictFile(p: string) {

0 commit comments

Comments
 (0)