Simplifiest compare
This commit is contained in:
parent
d73bf177d5
commit
36f9bfdaee
|
@ -33,11 +33,10 @@ walk(char *s)
|
||||||
static int
|
static int
|
||||||
compare(char *a, char *b)
|
compare(char *a, char *b)
|
||||||
{
|
{
|
||||||
int i = 0, al = walk(a) - a, bl = walk(b) - b;
|
char *aa = walk(a), *bb = walk(b);
|
||||||
if(al == bl)
|
while(a < aa && b < bb)
|
||||||
while(a[i] == b[i])
|
if(*a++ != *b++) return 0;
|
||||||
if(!a[i] || ++i >= al) return 1;
|
return 1;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue