Differences From Artifact [2085cbcbc6]:
- File src/0dev.org/commands/tbd/tbd.go — part of check-in [96db071674] at 2015-01-26 20:40:44 on branch trunk — Added tbd.slide as well (user: spaskalev, size: 4855) [annotate] [blame] [check-ins using]
To Artifact [00e85b5d82]:
- File src/0dev.org/commands/tbd/tbd.go — part of check-in [3861ae4c57] at 2015-01-26 21:32:47 on branch trunk — Added missing depends interation in the collecting handler (user: spaskalev, size: 4922) [annotate] [blame] [check-ins using]
| ︙ | |||
219 220 221 222 223 224 225 226 227 228 229 230 231 232 | 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 | + + + |
}
// Returns a handler that stores every seen task and an ancillary function to retrieve those
func collecting() (handler, func() tasks) {
var seen = make(map[*task]struct{})
return func(t *task) action {
seen[t] = struct{}{}
for _, dep := range t.depends {
seen[dep] = struct{}{}
}
return action{}
}, func() tasks {
seq := make(tasks, 0, len(seen))
for k, _ := range seen {
seq = append(seq, k)
}
sort.Stable(seq)
|
| ︙ |