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/Title.zig | |
| parent | de948492e8b38a79d5db9c506c1b7b82e86c6b12 (diff) | |
perf(html): reduce memory syscall
Diffstat (limited to 'src/eval/Title.zig')
| -rw-r--r-- | src/eval/Title.zig | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/eval/Title.zig b/src/eval/Title.zig index 730d512..2e89953 100644 --- a/src/eval/Title.zig +++ b/src/eval/Title.zig @@ -30,7 +30,7 @@ fn destroy(context: *anyopaque, alloc: Allocator) void { fn html(context: *anyopaque, alloc: Allocator) HTML.Error!HTML { const self: *Self = @ptrCast(@alignCast(context)); - var el = try HTML.init(alloc, .content, switch (self.level) { + var el = try HTML.Content.init(alloc, switch (self.level) { 1 => "h1", 2 => "h2", 3 => "h3", @@ -39,7 +39,6 @@ fn html(context: *anyopaque, alloc: Allocator) HTML.Error!HTML { 6 => "h6", else => unreachable, }); - errdefer el.deinit(); - try el.appendContent(try self.content.html(alloc)); - return el; + try el.append(try self.content.html(alloc)); + return el.element(); } |
