Skip to content

Commit

Permalink
Sort the result of All in bitfiled
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Jakub Sztandera <[email protected]>
  • Loading branch information
Jakub Sztandera committed Oct 4, 2019
1 parent b6d50c0 commit 2114440
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions chain/types/bitfield.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package types
import (
"fmt"
"io"
"sort"

"github.com/filecoin-project/go-lotus/extern/rleplus"
cbg "github.com/whyrusleeping/cbor-gen"
Expand Down Expand Up @@ -47,6 +48,8 @@ func (bf BitField) All() []uint64 {
for i := range bf.bits {
res = append(res, i)
}

sort.Slice(res, func(i, j int) bool { return res[i] < res[j] })
return res
}

Expand Down

0 comments on commit 2114440

Please sign in to comment.