aboutsummaryrefslogtreecommitdiff
path: root/src/string.cpp
diff options
context:
space:
mode:
authorgingerBill <ginger.bill.22@gmail.com>2016-08-15 13:46:01 +0100
committergingerBill <ginger.bill.22@gmail.com>2016-08-15 13:46:01 +0100
commit3ed75b22a357292393618fc684b18a1d167f4eb7 (patch)
tree9233d60f2a870416f09a833ecd31956f375120da /src/string.cpp
parent0f48a7d299a80c2e461bdcf5b37b5f624a48d7e8 (diff)
string comparisons
Diffstat (limited to 'src/string.cpp')
-rw-r--r--src/string.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/string.cpp b/src/string.cpp
index 1581feab9..d46700630 100644
--- a/src/string.cpp
+++ b/src/string.cpp
@@ -25,7 +25,12 @@ gb_inline String make_string(char *text) {
gb_inline b32 are_strings_equal(String a, String b) {
if (a.len == b.len) {
- return gb_memcompare(a.text, b.text, a.len) == 0;
+ for (isize i = 0; i < a.len; i++) {
+ if (a.text[i] != b.text[i]) {
+ return false;
+ }
+ }
+ return true;
}
return false;
}