Merge pull request #277 from filecoin-project/fix/bitfield-deterministic
Sort the result of All in bitfiled
This commit is contained in:
commit
7f1c90cc7b
@ -3,6 +3,7 @@ package types
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"sort"
|
||||
|
||||
"github.com/filecoin-project/go-lotus/extern/rleplus"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user