From 07dbb6538ca55e69a33ada6761e749f4ee06affe Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Fri, 22 Aug 2025 21:15:31 +0200 Subject: json: Improved parsing performance --- include/str.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/str.h') diff --git a/include/str.h b/include/str.h index 300d5ea..3ccd072 100644 --- a/include/str.h +++ b/include/str.h @@ -12,7 +12,14 @@ typedef struct { byte *data; size len; } Str; +typedef struct { + byte *data; + size len; +} StrView; i32 Str_equals(Str a, Str b); u64 Str_hash64(Str s); Str Str_copy(Arena *a, byte *data, size len); i32 Str_fprint(FILE *w, Str s); + +StrView Str_view(byte *data, size len); +i32 StrView_fprint(FILE *w, StrView s); -- cgit v1.3