Sort the result of All in bitfiled
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
parent
b6d50c07c8
commit
211444059c
@ -3,6 +3,7 @@ package types
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"sort"
|
||||||
|
|
||||||
"github.com/filecoin-project/go-lotus/extern/rleplus"
|
"github.com/filecoin-project/go-lotus/extern/rleplus"
|
||||||
cbg "github.com/whyrusleeping/cbor-gen"
|
cbg "github.com/whyrusleeping/cbor-gen"
|
||||||
@ -47,6 +48,8 @@ func (bf BitField) All() []uint64 {
|
|||||||
for i := range bf.bits {
|
for i := range bf.bits {
|
||||||
res = append(res, i)
|
res = append(res, i)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sort.Slice(res, func(i, j int) bool { return res[i] < res[j] })
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user