Skip to content

Commit

Permalink
Bump to Go 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
poszu committed Sep 14, 2023
1 parent 4ab25f7 commit 89955f0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/spacemeshos/poet

go 1.20
go 1.21

require (
github.com/c0mm4nd/go-ripemd v0.0.0-20200326052756-bd1759ad7d10
Expand Down
2 changes: 1 addition & 1 deletion registration/round.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func (r *round) flushPendingSubmitsLocked() {
r.members += len(r.pendingSubmits)
r.membersCounter.Add(float64(len(r.pendingSubmits)))

r.pendingSubmits = make(map[string]pendingSubmit)
clear(r.pendingSubmits)
r.batch = nil
}

Expand Down
6 changes: 3 additions & 3 deletions verifier/verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package verifier
import (
"bytes"
"fmt"
"sort"
"slices"

"github.com/spacemeshos/merkle-tree"

Expand Down Expand Up @@ -60,12 +60,12 @@ func Validate(proof shared.MerkleProof, labelHashFunc func(data []byte) []byte,
}

func asSortedSlice(s map[uint64]bool) []uint64 {
var ret []uint64
ret := make([]uint64, 0, len(s))
for key, value := range s {
if value {
ret = append(ret, key)
}
}
sort.Slice(ret, func(i, j int) bool { return ret[i] < ret[j] })
slices.Sort(ret)
return ret
}

0 comments on commit 89955f0

Please sign in to comment.