summaryrefslogtreecommitdiff
path: root/src/database.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/database.c')
-rw-r--r--src/database.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/database.c b/src/database.c
index a77e409..c4f8433 100644
--- a/src/database.c
+++ b/src/database.c
@@ -496,25 +496,25 @@ static struct apk_db_file *apk_db_file_get(struct apk_database *db,
static void apk_db_pkg_rdepends(struct apk_database *db, struct apk_package *pkg)
{
- int i, j;
- struct apk_name *rname;
+ struct apk_name *rname, **rd;
+ struct apk_dependency *d;
- for (i = 0; i < pkg->depends->num; i++) {
- rname = pkg->depends->item[i].name;
- for (j = 0; j < rname->rdepends->num; j++)
- if (rname->rdepends->item[j] == pkg->name)
+ foreach_array_item(d, pkg->depends) {
+ rname = d->name;
+ foreach_array_item(rd, rname->rdepends)
+ if (*rd == pkg->name)
goto rdeps_done;
*apk_name_array_add(&rname->rdepends) = pkg->name;
+rdeps_done: ;
}
-rdeps_done:
- for (i = 0; i < pkg->install_if->num; i++) {
- rname = pkg->install_if->item[i].name;
- for (j = 0; j < rname->rinstall_if->num; j++)
- if (rname->rinstall_if->item[j] == pkg->name)
+ foreach_array_item(d, pkg->install_if) {
+ rname = d->name;
+ foreach_array_item(rd, rname->rinstall_if)
+ if (*rd == pkg->name)
goto riif_done;
*apk_name_array_add(&rname->rinstall_if) = pkg->name;
+riif_done: ;
}
-riif_done:
return;
}