pkg: use goto cleanup idiom

Dylan Baker 2022-08-03 16:32:35 -07:00
parent b26f19cebf
commit 7fe770bec7
1 changed files with 3 additions and 6 deletions

View File

@ -1470,21 +1470,18 @@ pkgconf_pkg_walk_list(pkgconf_client_t *client,
if (pkgdep->serial == client->serial) if (pkgdep->serial == client->serial)
{ {
pkgdep->hits++; pkgdep->hits++;
pkgconf_pkg_unref(client, pkgdep); goto next;
continue;
} }
if (skip_flags && (depnode->flags & skip_flags) == skip_flags) if (skip_flags && (depnode->flags & skip_flags) == skip_flags)
{ goto next;
pkgconf_pkg_unref(client, pkgdep);
continue;
}
pkgconf_audit_log_dependency(client, pkgdep, depnode); pkgconf_audit_log_dependency(client, pkgdep, depnode);
pkgdep->hits++; pkgdep->hits++;
pkgdep->serial = client->serial; pkgdep->serial = client->serial;
eflags |= pkgconf_pkg_traverse_main(client, pkgdep, func, data, depth - 1, skip_flags); eflags |= pkgconf_pkg_traverse_main(client, pkgdep, func, data, depth - 1, skip_flags);
next:
pkgconf_pkg_unref(client, pkgdep); pkgconf_pkg_unref(client, pkgdep);
} }