mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04: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;
|
alpm_list_t *it = list;
|
||||||
|
|
||||||
while(it) {
|
if(fn) {
|
||||||
if(fn && it->data) {
|
while(it) {
|
||||||
fn(it->data);
|
if(it->data) {
|
||||||
|
fn(it->data);
|
||||||
|
}
|
||||||
|
it = it->next;
|
||||||
}
|
}
|
||||||
it = it->next;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user