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:
Laura Cressman authored and Olaoluwa Osuntokun committed 2017-10-02 23:13:47 -07:00
1 parent e106cfdef1
commit 8822bb11ce
1 file changed
+3 -1
+3 -1
View File
@@ -35,7 +35,9 @@ func TestHeapOrdering(t *testing.T) {
// Sort the regular slice, we'll compare this against all the entries
// 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
// out in sorted order.