Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

Commit

Permalink
feat(sorting): sort sector info by id
Browse files Browse the repository at this point in the history
  • Loading branch information
laser committed Sep 20, 2019
1 parent 641e9ea commit 67a3da8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bindings.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package go_sectorbuilder

import (
"bytes"
"encoding/json"
"os"
"runtime"
"sort"
Expand Down Expand Up @@ -38,7 +38,7 @@ type SortedSectorInfo struct {
// NewSortedSectorInfo returns a SortedSectorInfo
func NewSortedSectorInfo(sectorInfo ...SectorInfo) SortedSectorInfo {
fn := func(i, j int) bool {
return bytes.Compare(sectorInfo[i].CommR[:], sectorInfo[j].CommR[:]) == -1
return sectorInfo[i].SectorID < sectorInfo[j].SectorID
}

sort.Slice(sectorInfo[:], fn)
Expand Down

0 comments on commit 67a3da8

Please sign in to comment.