fixed a small bug in the Report function (#530)

This commit is contained in:
Pratik Patil 2022-09-27 12:31:13 +05:30 committed by Jerry
parent f7c041fdb1
commit d107c183b8

View file

@ -74,13 +74,19 @@ func BuildDAG(deps TxnInputOutput) (d DAG) {
func (d DAG) Report(out func(string)) {
roots := make([]int, 0)
rootIds := make([]string, 0)
rootIdMap := make(map[int]string, len(d.GetRoots()))
for k, i := range d.GetRoots() {
roots = append(roots, i.(int))
rootIds = append(rootIds, k)
rootIdMap[i.(int)] = k
}
sort.Ints(roots)
for _, i := range roots {
rootIds = append(rootIds, rootIdMap[i])
}
fmt.Println(roots)
makeStrs := func(ints []int) (ret []string) {