aboutsummaryrefslogtreecommitdiff
path: root/src/str.c
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2025-08-24 10:40:56 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2025-08-27 11:46:25 +0200
commitdd2c70e878e4bc7fcf26f33523a45f0d854a29e4 (patch)
tree28e0d7c8e3f213bc77c82ffbbb0bb2ba5ff5f253 /src/str.c
parent086cb73ef88a4962345b8284e47cea52da428135 (diff)
code simplification & macros
Diffstat (limited to 'src/str.c')
-rw-r--r--src/str.c13
1 files changed, 0 insertions, 13 deletions
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); }