Sort the result of All in bitfiled

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera 2019-10-04 20:18:11 +02:00
parent b6d50c07c8
commit 211444059c
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA

View File

@ -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
}