Turn string_is_equal into selfcontained function

This commit is contained in:
twinaphex 2017-04-21 14:09:02 +02:00
parent dd517f4660
commit 76788d3890

View File

@ -40,7 +40,11 @@ static INLINE bool string_is_empty(const char *data)
static INLINE bool string_is_equal(const char *a, const char *b)
{
return (a && b) ? (strcmp(a, b) == 0) : false;
if (!a || !b)
return false;
while(*a && (*a == *b))
a++, b++;
return (*(const unsigned char*)a - *(const unsigned char*)b) == 0;
}
static INLINE bool string_is_equal_noncase(const char *a, const char *b)