routing: replace sort.Sort with sort.Slice in heap_test.go
Use sort.Slice in TestHeapOrdering function in routing/heap_test.go, as part of the move to use new language features.
This commit is contained in:
parent
e106cfdef1
commit
8822bb11ce
@ -35,7 +35,9 @@ func TestHeapOrdering(t *testing.T) {
|
|||||||
|
|
||||||
// Sort the regular slice, we'll compare this against all the entries
|
// Sort the regular slice, we'll compare this against all the entries
|
||||||
// popped from the heap.
|
// popped from the heap.
|
||||||
sort.Sort(&distanceHeap{sortedEntries})
|
sort.Slice(sortedEntries, func(i, j int) bool {
|
||||||
|
return sortedEntries[i].dist < sortedEntries[j].dist
|
||||||
|
})
|
||||||
|
|
||||||
// One by one, pop of all the entries from the heap, they should come
|
// One by one, pop of all the entries from the heap, they should come
|
||||||
// out in sorted order.
|
// out in sorted order.
|
||||||
|
Loading…
Reference in New Issue
Block a user