diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-02 20:57:37 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-02 20:57:37 +0100 |
commit | b4507b3601bedcaa599673b9f9083d1574132157 (patch) | |
tree | a25a2f249f3434aa204da2095a26b220de188941 /backend/String.cpp | |
parent | c17df7d3e28e0eeb21f7a62d1c66f525b487a5fa (diff) |
more fixes
Diffstat (limited to 'backend/String.cpp')
-rw-r--r-- | backend/String.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/backend/String.cpp b/backend/String.cpp index 84dc2ec..8be6892 100644 --- a/backend/String.cpp +++ b/backend/String.cpp @@ -95,7 +95,9 @@ bool String::empty() const { bool operator == (const String & a, const String & b) { - return strncmp(a._data, b._data, min(a._data_len, b._data_len)) == 0; + if (a._data_len != b._data_len) return false; + if (a._data_len == 0) return true; + return strncmp(a._data, b._data, a._data_len) == 0; } bool operator != (const String & a, const String & b) { |