Commit 728eaaeb authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Replace complex comparison logic with strcmp.

parent e4f044d1
......@@ -242,18 +242,9 @@ destroyBFiledataPA ( void *v )
static bool
compareNamesAPA(void *v1, void *v2)
{
aFiledataPA *afd1, *afd2;
size_t len;
bool bret;
afd1 = ( aFiledataPA * ) v1;
afd2 = ( aFiledataPA * ) v2;
len = strlen ( afd1->name );
bret = ( len == strlen ( afd2->name ) &&
memcmp ( afd1->name, afd2->name, len ) == 0 );
aFiledataPA *afd1 = v1, *afd2 = v2;
return bret;
return !strcmp(afd1->name, afd2->name);
}
/***************************************************************/
......@@ -261,18 +252,9 @@ compareNamesAPA(void *v1, void *v2)
static bool
compareNamesBPA(void *v1, void *v2)
{
bFiledataPA *bfd1, *bfd2;
size_t len;
bool bret;
bfd1 = ( bFiledataPA * ) v1;
bfd2 = ( bFiledataPA * ) v2;
len = strlen ( bfd1->name );
bret = ( len == strlen ( bfd2->name ) &&
memcmp ( bfd1->name, bfd2->name, len ) == 0 );
bFiledataPA *bfd1 = v1, *bfd2 = v2;
return bret;
return !strcmp(bfd1->name, bfd2->name);
}
/***************************************************************/
......
......@@ -179,18 +179,9 @@ destroyBFiledataP(void *v)
static bool
compareNamesAP(void *v1, void *v2)
{
aFiledataP *afd1, *afd2;
size_t len;
bool bret;
afd1 = ( aFiledataP * ) v1;
afd2 = ( aFiledataP * ) v2;
len = strlen ( afd1->name );
bret = ( len == strlen ( afd2->name ) &&
memcmp ( afd1->name, afd2->name, len ) == 0 );
aFiledataP *afd1 = v1, *afd2 = v2;
return bret;
return !strcmp(afd1->name, afd2->name);
}
/***************************************************************/
......@@ -198,18 +189,9 @@ compareNamesAP(void *v1, void *v2)
static bool
compareNamesBP(void *v1, void *v2)
{
bFiledataP *bfd1, *bfd2;
size_t len;
bool bret;
bfd1 = ( bFiledataP * ) v1;
bfd2 = ( bFiledataP * ) v2;
len = strlen ( bfd1->name );
bret = ( len == strlen ( bfd2->name ) &&
memcmp ( bfd1->name, bfd2->name, len ) == 0 );
bFiledataP *bfd1 = v1, *bfd2 = v2;
return bret;
return !strcmp(bfd1->name, bfd2->name);
}
/***************************************************************/
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment