Skip to content

Commit

Permalink
lib/list.c: is_on_list(): Move code out of loop
Browse files Browse the repository at this point in the history
Signed-off-by: Alejandro Colomar <[email protected]>
  • Loading branch information
alejandro-colomar authored and hallyn committed Mar 14, 2024
1 parent 08ae38e commit fb01e07
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/list.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,12 @@ bool is_on_list (char *const *list, const char *member)
for (cp = members, i = 0;; i++) {
array[i] = cp;
cp = strchr(cp, ',');
if (NULL != cp) {
if (NULL != cp)
*cp++ = '\0';
} else {
array[i + 1] = NULL;
else
break;
}
}
array[i+1] = NULL;

/*
* Return the new array of pointers
Expand Down

0 comments on commit fb01e07

Please sign in to comment.