diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2024-10-30 12:24:23 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-30 12:24:23 +0000 |
| commit | f469bbb0049f618d09dd1dd962389c8306db6bbc (patch) | |
| tree | c9fc02d1e8a7583ba339d8402f17ff6874403394 /src/string.cpp | |
| parent | ee76acd665911e2f28d5183b3c0a07a665dbf858 (diff) | |
| parent | b59647084b11a7f08ad3aa54ae47ceb157f12c46 (diff) | |
Merge pull request #4425 from bobsayshilol/misc-fixes
Misc fixes
Diffstat (limited to 'src/string.cpp')
| -rw-r--r-- | src/string.cpp | 1 |
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); } |