Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
go-sectorbuilder
Commits
6153cd8b
Commit
6153cd8b
authored
Sep 24, 2019
by
laser
Browse files
feat(sorting): sort sector info by id
parent
b7280d07
Changes
1
Show whitespace changes
Inline
Side-by-side
bindings.go
View file @
6153cd8b
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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment