xbps-query: repo_revdeps_cb: simplify by using a dictionary iterator.
This commit is contained in:
parent
731c903026
commit
9ac3b60048
@ -88,17 +88,17 @@ static int
|
|||||||
repo_revdeps_cb(struct xbps_rindex *rpi, void *arg, bool *done)
|
repo_revdeps_cb(struct xbps_rindex *rpi, void *arg, bool *done)
|
||||||
{
|
{
|
||||||
prop_dictionary_t pkgd;
|
prop_dictionary_t pkgd;
|
||||||
prop_array_t allkeys, pkgdeps;
|
prop_array_t pkgdeps;
|
||||||
prop_dictionary_keysym_t ksym;
|
prop_object_iterator_t iter;
|
||||||
|
prop_object_t obj;
|
||||||
const char *pkgver, *arch, *pattern = arg;
|
const char *pkgver, *arch, *pattern = arg;
|
||||||
size_t i;
|
|
||||||
|
|
||||||
(void)done;
|
(void)done;
|
||||||
|
|
||||||
allkeys = prop_dictionary_all_keys(rpi->repod);
|
iter = prop_dictionary_iterator(rpi->repod);
|
||||||
for (i = 0; i < prop_array_count(allkeys); i++) {
|
assert(iter);
|
||||||
ksym = prop_array_get(allkeys, i);
|
while ((obj = prop_object_iterator_next(iter))) {
|
||||||
pkgd = prop_dictionary_get_keysym(rpi->repod, ksym);
|
pkgd = prop_dictionary_get_keysym(rpi->repod, obj);
|
||||||
pkgdeps = prop_dictionary_get(pkgd, "run_depends");
|
pkgdeps = prop_dictionary_get(pkgd, "run_depends");
|
||||||
if (pkgdeps == NULL || prop_array_count(pkgdeps) == 0)
|
if (pkgdeps == NULL || prop_array_count(pkgdeps) == 0)
|
||||||
continue;
|
continue;
|
||||||
@ -113,7 +113,7 @@ repo_revdeps_cb(struct xbps_rindex *rpi, void *arg, bool *done)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prop_object_release(allkeys);
|
prop_object_iterator_release(iter);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user