From 22c7aa339407042682eef78f7d1ae1398e1d9b79 Mon Sep 17 00:00:00 2001 From: Anhgelus Morhtuuzh Date: Fri, 24 Apr 2026 20:37:53 +0200 Subject: perf(lexer): replace nextKind by peek --- src/content.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/content.zig') diff --git a/src/content.zig b/src/content.zig index e91576d..72acbc7 100644 --- a/src/content.zig +++ b/src/content.zig @@ -31,13 +31,13 @@ pub fn parse(alloc: Allocator, l: *Lexer) Error!Element { fn parseModifier(alloc: Allocator, l: *Lexer, knd: Token.Kind, tag: []const u8) Error!Element { var el = try Element.init(alloc, .content, tag); errdefer el.deinit(); - while (l.nextKind()) |it| { - if (it == knd) { + while (l.peek()) |next| { + if (next.kind == knd) { // consuming the finisher - _ = l.next(); + l.consume(); return el; } - if (it.isDelimiter()) return Error.ModifierNotClosed; + if (next.kind.isDelimiter()) return Error.ModifierNotClosed; try el.appendContent(try parse(alloc, l)); } return Error.ModifierNotClosed; -- cgit v1.2.3