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.
pull/239/head
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,6 +116,8 @@ pkgconf_queue_collect_dependents(pkgconf_client_t *client, pkgconf_pkg_t *pkg, v
if (pkg == world) if (pkg == world)
return; return;
if (!(pkg->flags & PKGCONF_PKG_PKGF_SEARCH_PRIVATE))
{
PKGCONF_FOREACH_LIST_ENTRY(pkg->required.head, node) PKGCONF_FOREACH_LIST_ENTRY(pkg->required.head, node)
{ {
pkgconf_dependency_t *flattened_dep; pkgconf_dependency_t *flattened_dep;
@ -124,7 +126,9 @@ pkgconf_queue_collect_dependents(pkgconf_client_t *client, pkgconf_pkg_t *pkg, v
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_FOREACH_LIST_ENTRY(pkg->requires_private.head, node)
{ {
pkgconf_dependency_t *flattened_dep; pkgconf_dependency_t *flattened_dep;
@ -133,6 +137,7 @@ pkgconf_queue_collect_dependents(pkgconf_client_t *client, pkgconf_pkg_t *pkg, v
pkgconf_node_insert(&flattened_dep->iter, flattened_dep, &world->requires_private); pkgconf_node_insert(&flattened_dep->iter, flattened_dep, &world->requires_private);
} }
}
} }
static int static int