Skip to content

Commit 2258bf2

Browse files
authored
perf(http): increase performance of HTML rendering (#6727)
1 parent 5e9455e commit 2258bf2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

http/file_server.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,12 @@ function html(
432432
strings: TemplateStringsArray,
433433
...values: unknown[]
434434
): string {
435-
return String.raw({ raw: strings }, ...values);
435+
let out = "";
436+
for (let i = 0; i < strings.length; ++i) {
437+
out += strings[i];
438+
if (i < values.length) out += values[i] ?? "";
439+
}
440+
return out;
436441
}
437442

438443
function dirViewerTemplate(dirname: string, entries: EntryInfo[]): string {

0 commit comments

Comments
 (0)