mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 23:28:48 +00:00
Use memcmp for str_eq
This commit is contained in:
+1
-6
@@ -170,12 +170,7 @@ GB_COMPARE_PROC(string_cmp_proc) {
|
|||||||
|
|
||||||
gb_inline bool str_eq(String const &a, String const &b) {
|
gb_inline bool str_eq(String const &a, String const &b) {
|
||||||
if (a.len != b.len) return false;
|
if (a.len != b.len) return false;
|
||||||
for (isize i = 0; i < a.len; i++) {
|
return memcmp(a.text, b.text, a.len) == 0;
|
||||||
if (a.text[i] != b.text[i]) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
gb_inline bool str_ne(String const &a, String const &b) { return !str_eq(a, b); }
|
gb_inline bool str_ne(String const &a, String const &b) { return !str_eq(a, b); }
|
||||||
gb_inline bool str_lt(String const &a, String const &b) { return string_compare(a, b) < 0; }
|
gb_inline bool str_lt(String const &a, String const &b) { return string_compare(a, b) < 0; }
|
||||||
|
|||||||
Reference in New Issue
Block a user