made str_equals faster

This commit is contained in:
Timerix 2025-08-10 17:21:55 +03:00
parent a097d5aff9
commit 8eeaff4245

View File

@ -14,12 +14,14 @@ str str_copy(str src){
bool str_equals(str s0, str s1){ bool str_equals(str s0, str s1){
if(s0.size != s1.size) if(s0.size != s1.size)
return false; return false;
/*
for(u32 i = 0; i < s0.size; i++) BENCHMARK:
if(s0.data[i] != s1.data[i]) str_equals64: 2.967s
return false; strcmp: 4.143s
strncmp: 1.611s
return true; memcmp: 0.710s
*/
return memcmp(s0.data, s1.data, s0.size) == 0;
} }
str str_reverse(str s){ str str_reverse(str s){