From 6153cd8b91b22c8674c693203cfbce112c488344 Mon Sep 17 00:00:00 2001 From: laser Date: Tue, 24 Sep 2019 14:39:20 -0700 Subject: [PATCH] feat(sorting): sort sector info by id --- bindings.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bindings.go b/bindings.go index 9f5ff99..d9bc25e 100644 --- a/bindings.go +++ b/bindings.go @@ -1,7 +1,6 @@ package go_sectorbuilder import ( - "bytes" "encoding/json" "os" "runtime" @@ -39,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)