mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-22 07:48:50 -05:00
libalpm: move function pointer condition
Function pointer gets uselessly compared for NULL in every iteration. Move the condition to do it just once. Signed-off-by: slavomir vlcek <svlc@inventati.org> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
d79872b4c7
commit
e5f23e0ebb
@ -70,11 +70,13 @@ void SYMEXPORT alpm_list_free_inner(alpm_list_t *list, alpm_list_fn_free fn)
|
||||
{
|
||||
alpm_list_t *it = list;
|
||||
|
||||
while(it) {
|
||||
if(fn && it->data) {
|
||||
fn(it->data);
|
||||
if(fn) {
|
||||
while(it) {
|
||||
if(it->data) {
|
||||
fn(it->data);
|
||||
}
|
||||
it = it->next;
|
||||
}
|
||||
it = it->next;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user