diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2026-04-27 16:16:49 +0200 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2026-04-27 16:16:49 +0200 |
| commit | 9f1a0bf3b0437770a7b62fd28a8748908c38dac4 (patch) | |
| tree | 0967564e0903b5b27a5f39381011cc8a684a7539 /src/eval/list.zig | |
| parent | de948492e8b38a79d5db9c506c1b7b82e86c6b12 (diff) | |
perf(html): reduce memory syscall
Diffstat (limited to 'src/eval/list.zig')
| -rw-r--r-- | src/eval/list.zig | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/eval/list.zig b/src/eval/list.zig index 6954fd1..08f180a 100644 --- a/src/eval/list.zig +++ b/src/eval/list.zig @@ -34,14 +34,13 @@ fn List(comptime tag: []const u8) type { fn html(context: *anyopaque, alloc: Allocator) HTML.Error!HTML { const self: *Self = @ptrCast(@alignCast(context)); - var el = try HTML.init(alloc, .content, tag); - errdefer el.deinit(); + var el = try HTML.Content.init(alloc, tag); for (self.content.items) |it| { - var li = try HTML.init(alloc, .content, "li"); - try li.appendContent(try it.html(alloc)); - try el.appendContent(li); + var li = try HTML.Content.init(alloc, "li"); + try li.append(try it.html(alloc)); + try el.append(li.element()); } - return el; + return el.element(); } }; } |
