diff options
| author | 2024-11-17 07:33:47 -0800 | |
|---|---|---|
| committer | 2024-11-17 07:33:47 -0800 | |
| commit | bafa6bfff01a03e7e25cd476ae6396e88622358b (patch) | |
| tree | 4dfd099f28e9ca267bd8b329f68dc58474a703d2 | |
| parent | Merge pull request #1518 from pyrmont/bugfix.s390x-workflow (diff) | |
| parent | fix janet_string_equalconst (diff) | |
Merge pull request #1519 from ianthehenry/fix-string-equal-with-byteview
fix janet_string_equalconst
| -rw-r--r-- | src/core/string.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/string.c b/src/core/string.c index 277b1a25..6a67482c 100644 --- a/src/core/string.c +++ b/src/core/string.c @@ -71,10 +71,10 @@ int janet_string_compare(const uint8_t *lhs, const uint8_t *rhs) { int janet_string_equalconst(const uint8_t *lhs, const uint8_t *rhs, int32_t rlen, int32_t rhash) { int32_t lhash = janet_string_hash(lhs); int32_t llen = janet_string_length(lhs); - if (lhs == rhs) - return 1; if (lhash != rhash || llen != rlen) return 0; + if (lhs == rhs) + return 1; return !memcmp(lhs, rhs, rlen); } |
