From dd2c70e878e4bc7fcf26f33523a45f0d854a29e4 Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Sun, 24 Aug 2025 10:40:56 +0200 Subject: code simplification & macros --- src/str.c | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'src/str.c') diff --git a/src/str.c b/src/str.c index 7efc684..3523d98 100644 --- a/src/str.c +++ b/src/str.c @@ -5,11 +5,6 @@ #include "../include/memory.h" #include "../include/str.h" -// Returns 1 if strings are equal, 0 otherwise -i32 Str_equals(Str a, Str b) { - return (a.len == b.len) && (!a.len || !memcmp(a.data, b.data, a.len)); -} - u64 Str_hash64(Str s) { u64 h = 0x100; for (size i = 0; i < s.len; i++) { @@ -27,10 +22,6 @@ Str Str_copy(Arena *a, byte *data, size len) { return str; } -i32 Str_fprint(FILE *w, Str s) { - return fprintf(w, "%.*s", (i32)s.len, s.data); -} - StrView Str_view(byte *data, size len) { StrView str = {0}; str.len = len; @@ -38,8 +29,4 @@ StrView Str_view(byte *data, size len) { return str; } -i32 StrView_fprint(FILE *w, StrView s) { - return fprintf(w, "%.*s", (i32)s.len, s.data); -} - Str StrView_copy(Arena *a, StrView s) { return Str_copy(a, s.data, s.len); } -- cgit v1.3