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 2019-10-24 21:43:29 +02:00
parent ccb27b9705
commit c28605aec5
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 8 additions and 4 deletions

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;
}