Improve "depends" awk statement
We can save a set of braces by using "continue". Also removed a spurious variable assignment.
This commit is contained in:
parent
a1cf729b51
commit
d124c46078
16
apt-cyg
16
apt-cyg
|
@ -285,19 +285,17 @@ case "$command" in
|
|||
END {
|
||||
p[1] = query
|
||||
d[query] = 0
|
||||
i = 1
|
||||
while (length(p)) {
|
||||
key = p[length(p)]
|
||||
depth = d[key]
|
||||
delete p[length(p)]
|
||||
if (!s[key]++) {
|
||||
printf "%*s%s\n", depth, "", key
|
||||
split(a[key], r)
|
||||
delete r[1]
|
||||
for (req in r) {
|
||||
p[length(p) + 1] = r[req]
|
||||
d[r[req]] = depth + 1
|
||||
}
|
||||
if (s[key]++) continue
|
||||
printf "%*s%s\n", depth, "", key
|
||||
split(a[key], r)
|
||||
delete r[1]
|
||||
for (req in r) {
|
||||
p[length(p) + 1] = r[req]
|
||||
d[r[req]] = depth + 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue