mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
fixed a small bug in the Report function (#530)
This commit is contained in:
parent
f7c041fdb1
commit
d107c183b8
1 changed files with 7 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue