File tree Expand file tree Collapse file tree 2 files changed +5
-11
lines changed Expand file tree Collapse file tree 2 files changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ package handshake
17
17
import (
18
18
"errors"
19
19
"fmt"
20
- "sort "
20
+ "slices "
21
21
22
22
"github.com/blinklabs-io/gouroboros/protocol"
23
23
)
@@ -105,9 +105,7 @@ func (s *Server) handleProposeVersions(msg protocol.Message) error {
105
105
}
106
106
107
107
// sort asending - iterating over map is not deterministic
108
- sort .Slice (supportedVersions , func (i , j int ) bool {
109
- return supportedVersions [i ] < supportedVersions [j ]
110
- })
108
+ slices .Sort (supportedVersions )
111
109
112
110
msgRefuse := NewMsgRefuse (
113
111
[]any {
Original file line number Diff line number Diff line change 14
14
15
15
package protocol
16
16
17
- import "sort "
17
+ import "slices "
18
18
19
19
// The NtC protocol versions have the 15th bit set in the handshake
20
20
const ProtocolVersionNtCOffset = 0x8000
@@ -322,9 +322,7 @@ func GetProtocolVersionsNtC() []uint16 {
322
322
}
323
323
324
324
// sort asending - iterating over map is not deterministic
325
- sort .Slice (versions , func (i , j int ) bool {
326
- return versions [i ] < versions [j ]
327
- })
325
+ slices .Sort (versions )
328
326
329
327
return versions
330
328
}
@@ -339,9 +337,7 @@ func GetProtocolVersionsNtN() []uint16 {
339
337
}
340
338
341
339
// sort asending - iterating over map is not deterministic
342
- sort .Slice (versions , func (i , j int ) bool {
343
- return versions [i ] < versions [j ]
344
- })
340
+ slices .Sort (versions )
345
341
346
342
return versions
347
343
}
You can’t perform that action at this time.
0 commit comments