aboutsummaryrefslogtreecommitdiff
path: root/src/string.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-10-30 14:12:57 +0000
committergingerBill <bill@gingerbill.org>2024-10-30 14:12:57 +0000
commit8a00d85cea02f38164b18d9a7e3e7d710c7a6c40 (patch)
tree67c7f058ddf65e64189d4a76add9d6ad685b366d /src/string.cpp
parent2392300ffbc86b09fde2a4d170b8c38f8ad0d382 (diff)
parentf469bbb0049f618d09dd1dd962389c8306db6bbc (diff)
Merge branch 'master' of https://github.com/odin-lang/Odin
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); }