From 609ee13e23190e6da99b4ba8870c5c4e0d1087c1 Mon Sep 17 00:00:00 2001 From: Ole Morud Date: Fri, 14 Nov 2025 07:31:17 +0100 Subject: [PATCH] s8slice: add bool s8_equals(a, b) function --- s8slice.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/s8slice.h b/s8slice.h index eb8ccfe..2f6847f 100644 --- a/s8slice.h +++ b/s8slice.h @@ -37,3 +37,11 @@ static inline S8Slice s8slice(const S8Slice* s, int64_t begin, int64_t end) .data = &s->data[begin] }; } + +static bool s8_equals(S8Slice a, S8Slice b) +{ + if (a.len != b.len) { + return false; + } + return memcmp(a.data, b.data, a.len); +}