pkg: pkg_walk_list() does not need a reference to the parent node in the graph

feature/tap-sh
William Pitcock 2012-05-03 17:20:39 +00:00
parent ccda6b3752
commit 1caa0dca87
1 changed files with 3 additions and 4 deletions

7
pkg.c
View File

@ -301,8 +301,7 @@ pkg_verify_graph(pkg_t *root, int depth, unsigned int flags)
}
static inline void
pkg_walk_list(pkg_t *parent,
pkg_dependency_t *deplist,
pkg_walk_list(pkg_dependency_t *deplist,
void (*pkg_traverse_func)(pkg_t *package, void *data),
void *data,
int maxdepth,
@ -346,10 +345,10 @@ pkg_traverse(pkg_t *root,
if (maxdepth == 0)
return;
pkg_walk_list(root, root->requires, pkg_traverse_func, data, maxdepth - 1, flags);
pkg_walk_list(root->requires, pkg_traverse_func, data, maxdepth - 1, flags);
if (flags & PKGF_SEARCH_PRIVATE)
pkg_walk_list(root, root->requires_private, pkg_traverse_func, data, maxdepth - 1, flags);
pkg_walk_list(root->requires_private, pkg_traverse_func, data, maxdepth - 1, flags);
if (pkg_traverse_func != NULL)
pkg_traverse_func(root, data);