1
0
mirror of git://projects.qi-hardware.com/wernermisc.git synced 2024-11-29 10:53:43 +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; continue;
push(pkg); push(pkg);
more_deps.refs = pkg->depends; more_deps.refs = pkg->depends;
if (next_dep) { more_deps.next = next_dep;
more_deps.next = next_dep->next;
next_dep->next = &more_deps;
} else {
more_deps.next = NULL;
}
more_conf.refs = pkg->conflicts; more_conf.refs = pkg->conflicts;
more_conf.next = conf; more_conf.next = conf;
resolve(next_dep ? next_dep : &more_deps, dep->next, resolve(&more_deps, dep->next, &more_conf);
&more_conf); next_dep = more_deps.next;
if (next_dep)
next_dep->next = more_deps.next;
pop(); pop();
} }
} }