aboutsummaryrefslogtreecommitdiff
path: root/src/string.cpp
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2024-10-30 12:24:23 +0000
committerGitHub <noreply@github.com>2024-10-30 12:24:23 +0000
commitf469bbb0049f618d09dd1dd962389c8306db6bbc (patch)
treec9fc02d1e8a7583ba339d8402f17ff6874403394 /src/string.cpp
parentee76acd665911e2f28d5183b3c0a07a665dbf858 (diff)
parentb59647084b11a7f08ad3aa54ae47ceb157f12c46 (diff)
Merge pull request #4425 from bobsayshilol/misc-fixes
Misc fixes
Diffstat (limited to 'src/string.cpp')
-rw-r--r--src/string.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/string.cpp b/src/string.cpp
index 3c7d96934..190b69041 100644
--- a/src/string.cpp
+++ b/src/string.cpp
@@ -156,6 +156,7 @@ gb_internal isize string_index_byte(String const &s, u8 x) {
gb_internal gb_inline bool str_eq(String const &a, String const &b) {
if (a.len != b.len) return false;
+ if (a.len == 0) return true;
return memcmp(a.text, b.text, a.len) == 0;
}
gb_internal gb_inline bool str_ne(String const &a, String const &b) { return !str_eq(a, b); }