From 3b0e9424a66058da82d11d432da886ec7b6ce7eb Mon Sep 17 00:00:00 2001 From: Anhgelus Morhtuuzh Date: Mon, 27 Apr 2026 17:45:13 +0200 Subject: perf(eval): reduce memory syscall --- src/paragraph.zig | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'src/paragraph.zig') diff --git a/src/paragraph.zig b/src/paragraph.zig index b50b2ec..e1a01cf 100644 --- a/src/paragraph.zig +++ b/src/paragraph.zig @@ -15,7 +15,6 @@ pub const Error = content.Error || link.Error || Allocator.Error; pub fn parse(alloc: Allocator, l: *Lexer) Error!Element { var el = try Paragraph.Block.init(alloc); - errdefer el.deinit(alloc); while (l.peek()) |next| switch (next.kind) { .strong_delimiter => return el.element(), .weak_delimiter => { @@ -31,19 +30,10 @@ pub fn parse(alloc: Allocator, l: *Lexer) Error!Element { pub fn parseLine(alloc: Allocator, l: *Lexer) Error!Element { var line = try Element.Empty.init(alloc); - errdefer line.deinit(alloc); while (l.peek()) |next| switch (next.kind) { .weak_delimiter, .strong_delimiter => return line.element(), - .link => { - var el = try link.parse(alloc, l); - errdefer el.deinit(alloc); - try line.content.append(alloc, el); - }, - else => { - var el = try content.parse(alloc, l); - errdefer el.deinit(alloc); - try line.content.append(alloc, el); - }, + .link => try line.content.append(alloc, try link.parse(alloc, l)), + else => try line.content.append(alloc, try content.parse(alloc, l)), }; return line.element(); } -- cgit v1.2.3