core: string_equal_p: Prepare for M2-Planet.

* src/string.c (string_equal_p): Prepare for M2-Planet.
This commit is contained in:
Jan (janneke) Nieuwenhuizen 2020-07-16 21:43:29 +02:00
parent 7e8c6585a0
commit 80c84dc069
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273

View file

@ -77,11 +77,15 @@ string_equal_p (SCM a, SCM b) /*:((name . "string=?")) */
eputs ("\n");
assert_msg ((TYPE (a) == TSTRING && TYPE (b) == TSTRING) || (TYPE (a) == TKEYWORD || TYPE (b) == TKEYWORD), "(TYPE (a) == TSTRING && TYPE (b) == TSTRING) || (TYPE (a) == TKEYWORD || TYPE (b) == TKEYWORD)");
}
if (a == b
|| STRING (a) == STRING (b)
|| (LENGTH (a) == 0 && LENGTH (b) == 0)
|| (LENGTH (a) == LENGTH (b) && !memcmp (cell_bytes (STRING (a)), cell_bytes (STRING (b)), LENGTH (a))))
if (a == b)
return cell_t;
if (STRING (a) == STRING (b))
return cell_t;
if (LENGTH (a) == 0 && LENGTH (b) == 0)
return cell_t;
if (LENGTH (a) == LENGTH (b))
if (memcmp (cell_bytes (STRING (a)), cell_bytes (STRING (b)), LENGTH (a)) == 0)
return cell_t;
return cell_f;
}