Fix predicated visitors.

This change makes the Context.visitDepsDepthFirstIf() method descend into
modules for which the predicate is false rather than skipping their entire
sub-DAG.

Change-Id: I50564c69a714d5e199e1a51a8aa24162b0dc6f11
This commit is contained in:
Jamie Gennis 2014-11-26 14:45:37 -08:00 committed by Colin Cross
parent b2e7b5d036
commit 0bb5d8a8d9

View file

@ -1068,12 +1068,12 @@ func (c *Context) visitDepsDepthFirstIf(module Module, pred func(Module) bool,
walk = func(m Module) {
info := c.moduleInfo[m]
visited[m] = true
if pred(m) {
for _, dep := range info.directDeps {
if !visited[dep] {
walk(dep)
}
for _, dep := range info.directDeps {
if !visited[dep] {
walk(dep)
}
}
if pred(m) {
visit(m)
}
}