queue: when collecting dependents don't iterate private twice

Currently, the private field is iterated collecting private deps and
normal deps. It should only be iterated when collecting private deps.
master
Dylan Baker 2022-08-03 16:40:04 -07:00
parent 4493a322f6
commit a46ce3672f
1 changed files with 14 additions and 9 deletions

View File

@ -116,22 +116,27 @@ pkgconf_queue_collect_dependents(pkgconf_client_t *client, pkgconf_pkg_t *pkg, v
if (pkg == world) if (pkg == world)
return; return;
PKGCONF_FOREACH_LIST_ENTRY(pkg->required.head, node) if (!(pkg->flags & PKGCONF_PKG_PKGF_SEARCH_PRIVATE))
{ {
pkgconf_dependency_t *flattened_dep; PKGCONF_FOREACH_LIST_ENTRY(pkg->required.head, node)
{
pkgconf_dependency_t *flattened_dep;
flattened_dep = pkgconf_dependency_copy(client, node->data); flattened_dep = pkgconf_dependency_copy(client, node->data);
pkgconf_node_insert(&flattened_dep->iter, flattened_dep, &world->required); pkgconf_node_insert(&flattened_dep->iter, flattened_dep, &world->required);
}
} }
else
PKGCONF_FOREACH_LIST_ENTRY(pkg->requires_private.head, node)
{ {
pkgconf_dependency_t *flattened_dep; PKGCONF_FOREACH_LIST_ENTRY(pkg->requires_private.head, node)
{
pkgconf_dependency_t *flattened_dep;
flattened_dep = pkgconf_dependency_copy(client, node->data); flattened_dep = pkgconf_dependency_copy(client, node->data);
pkgconf_node_insert(&flattened_dep->iter, flattened_dep, &world->requires_private); pkgconf_node_insert(&flattened_dep->iter, flattened_dep, &world->requires_private);
}
} }
} }