From 211444059cb15fbe253e5cbb5b252cfacf789a76 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Fri, 4 Oct 2019 20:18:11 +0200 Subject: [PATCH] Sort the result of All in bitfiled License: MIT Signed-off-by: Jakub Sztandera --- chain/types/bitfield.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chain/types/bitfield.go b/chain/types/bitfield.go index 347895f09..b309347d6 100644 --- a/chain/types/bitfield.go +++ b/chain/types/bitfield.go @@ -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 }