mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-10 03:30:19 +01:00
shared: refactor nm_utils_g_slist_strlist_cmp() to avoid dead-code warning from Coverity
Coverity sees that "return 0" cannot be reached. Refactor the code, to avoid the warning.
This commit is contained in:
parent
d76df4c139
commit
8fb954b81d
1 changed files with 8 additions and 3 deletions
|
|
@ -2834,10 +2834,15 @@ nm_utils_g_slist_find_str (const GSList *list,
|
|||
int
|
||||
nm_utils_g_slist_strlist_cmp (const GSList *a, const GSList *b)
|
||||
{
|
||||
for (; a && b; a = a->next, b = b->next)
|
||||
while (TRUE) {
|
||||
if (!a)
|
||||
return !b ? 0 : -1;
|
||||
if (!b)
|
||||
return 1;
|
||||
NM_CMP_DIRECT_STRCMP0 (a->data, b->data);
|
||||
NM_CMP_SELF (a, b);
|
||||
return 0;
|
||||
a = a->next;
|
||||
b = b->next;
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue