simplify byteArrayEqual()

This commit is contained in:
Joel Dice 2007-06-14 17:56:40 -06:00
parent 8d7cd5482f
commit 375715fb72

View File

@ -630,13 +630,9 @@ hash(const int8_t* s, unsigned length)
bool
byteArrayEqual(Thread* t, object a, object b)
{
if (a == b) return true;
if (byteArrayLength(t, a) == byteArrayLength(t, b)) {
return strcmp(byteArrayBody(t, a), byteArrayBody(t, b)) == 0;
} else {
return false;
}
return a == b or
((byteArrayLength(t, a) == byteArrayLength(t, b)) and
strcmp(byteArrayBody(t, a), byteArrayBody(t, b)) == 0);
}
object