Skip to content

Commit bafa6bf

Browse files
authored
Merge pull request #1519 from ianthehenry/fix-string-equal-with-byteview
fix janet_string_equalconst
2 parents 9f4497a + e2eb7ab commit bafa6bf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/core/string.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ int janet_string_compare(const uint8_t *lhs, const uint8_t *rhs) {
7171
int janet_string_equalconst(const uint8_t *lhs, const uint8_t *rhs, int32_t rlen, int32_t rhash) {
7272
int32_t lhash = janet_string_hash(lhs);
7373
int32_t llen = janet_string_length(lhs);
74-
if (lhs == rhs)
75-
return 1;
7674
if (lhash != rhash || llen != rlen)
7775
return 0;
76+
if (lhs == rhs)
77+
return 1;
7878
return !memcmp(lhs, rhs, rlen);
7979
}
8080

0 commit comments

Comments
 (0)