s8slice: add bool s8_equals(a, b) function

This commit is contained in:
2025-11-14 07:31:17 +01:00
parent a660c76fb7
commit 609ee13e23

View File

@@ -37,3 +37,11 @@ static inline S8Slice s8slice(const S8Slice* s, int64_t begin, int64_t end)
.data = &s->data[begin] .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);
}