aboutsummaryrefslogtreecommitdiff
path: root/src/link.zig
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2026-04-24 20:37:53 +0200
committerAnhgelus Morhtuuzh <william@herges.fr>2026-04-24 20:43:27 +0200
commit22c7aa339407042682eef78f7d1ae1398e1d9b79 (patch)
treea7ba615e5a98e32c53e9144e042e6f6a9f3c89d2 /src/link.zig
parente7fa254387e450154f03b2d1bdef361a0adb80d1 (diff)
perf(lexer): replace nextKind by peek
Diffstat (limited to 'src/link.zig')
-rw-r--r--src/link.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/link.zig b/src/link.zig
index d5ffe3c..eb13447 100644
--- a/src/link.zig
+++ b/src/link.zig
@@ -37,11 +37,11 @@ pub fn parseData(alloc: Allocator, l: *Lexer) Error!Data {
}
var el = Element.initEmpty(alloc);
errdefer el.deinit();
- while (l.nextKind()) |kind| {
- switch (kind) {
+ while (l.peek()) |next| {
+ switch (next.kind) {
.weak_delimiter, .strong_delimiter => return Error.InvalidLink,
.link => {
- const next = l.next().?;
+ l.consume();
if (!eql(u8, next.content, "](")) return Error.InvalidLink;
break;
},