Skip to content

Commit 96be7cf

Browse files
committed
Fix dep warnings
1 parent 3e666ec commit 96be7cf

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/SortingAlgorithms.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module SortingAlgorithms
22

33
using Compat
4+
import Compat.view
45
using Base.Sort
56
using Base.Order
67

@@ -22,7 +23,7 @@ const RadixSort = RadixSortAlg()
2223

2324
function sort!(v::AbstractVector, lo::Int, hi::Int, a::HeapSortAlg, o::Ordering)
2425
if lo > 1 || hi < length(v)
25-
return sort!(sub(v, lo:hi), 1, length(v), a, o)
26+
return sort!(view(v, lo:hi), 1, length(v), a, o)
2627
end
2728
r = ReverseOrdering(o)
2829
heapify!(v, r)
@@ -548,7 +549,7 @@ function sort!(v::AbstractVector, lo::Int, hi::Int, ::TimSortAlg, o::Ordering)
548549
else
549550
if !issorted(run_range)
550551
run_range = last(run_range):first(run_range)
551-
reverse!(sub(v, run_range))
552+
reverse!(view(v, run_range))
552553
end
553554
end
554555
# Push this run onto the queue and merge if needed

test/runtests.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Base.Test
22
using SortingAlgorithms
33
using Compat
4+
using StatsBase
45

56
a = rand(1:10000, 1000)
67

@@ -56,14 +57,14 @@ srand(0xdeadbeef)
5657
for n in [0:10..., 100, 101, 1000, 1001]
5758
r = 1:10
5859
v = rand(1:10,n)
59-
h = hist(v,r)
60+
h = fit(Histogram, v, r)
6061

6162
for ord in [Base.Order.Forward, Base.Order.Reverse]
6263
# insertion sort (stable) as reference
6364
pi = sortperm(v, alg=InsertionSort, order=ord)
6465
@test isperm(pi)
6566
si = v[pi]
66-
@test hist(si,r) == h
67+
@test fit(Histogram, si, r) == h
6768
@test issorted(si, order=ord)
6869
@test all(issorted,[pi[si.==x] for x in r])
6970
c = copy(v)

0 commit comments

Comments
 (0)