1
0
mirror of git://projects.qi-hardware.com/wernermisc.git synced 2024-12-22 12:34:36 +02:00

qpkg/prereq.c (resolve): simplify requisites chaining logic

Tried to keep next_dep at the beginning, but that's actually unnecessary.
The historical background is that the dependency list pointer was
originally thought to point to the list currently being processes. But
since it's a list following it, we don't need to maintain the original
order.
This commit is contained in:
Werner Almesberger 2010-11-19 14:25:33 -03:00
parent c90fcba126
commit fe14aa01d5

View File

@ -183,18 +183,11 @@ static void resolve(struct list *next_dep, const struct ref *dep,
continue;
push(pkg);
more_deps.refs = pkg->depends;
if (next_dep) {
more_deps.next = next_dep->next;
next_dep->next = &more_deps;
} else {
more_deps.next = NULL;
}
more_deps.next = next_dep;
more_conf.refs = pkg->conflicts;
more_conf.next = conf;
resolve(next_dep ? next_dep : &more_deps, dep->next,
&more_conf);
if (next_dep)
next_dep->next = more_deps.next;
resolve(&more_deps, dep->next, &more_conf);
next_dep = more_deps.next;
pop();
}
}