Skip to content

Commit b22ce55

Browse files
fredrikekreararslan
authored andcommitted
fixes for julia 0.7 (#30)
1 parent 891173f commit b22ce55

File tree

4 files changed

+8
-14
lines changed

4 files changed

+8
-14
lines changed

Diff for: .travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ os:
33
- osx
44
- linux
55
julia:
6-
- 0.6
6+
- 0.7
77
- nightly
88
notifications:
99
email: false

Diff for: REQUIRE

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
julia 0.6
2-
Compat 0.9.4
3-
DataStructures 0.5.3
1+
julia 0.7-alpha
2+
DataStructures 0.9.0

Diff for: src/SortingAlgorithms.jl

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ __precompile__()
22

33
module SortingAlgorithms
44

5-
using Compat
65
using DataStructures
7-
import Compat.view
86
using Base.Sort
97
using Base.Order
108

@@ -69,14 +67,14 @@ function sort!(vs::AbstractVector, lo::Int, hi::Int, ::RadixSortAlg, o::Ordering
6967

7068
# Make sure we're sorting a bits type
7169
T = Base.Order.ordtype(o, vs)
72-
if !isbits(T)
70+
if !isbitstype(T)
7371
error("Radix sort only sorts bits types (got $T)")
7472
end
7573

7674
# Init
7775
iters = ceil(Integer, sizeof(T)*8/RADIX_SIZE)
7876
bin = zeros(UInt32, 2^RADIX_SIZE, iters)
79-
if lo > 1; bin[1,:] = lo-1; end
77+
if lo > 1; bin[1,:] .= lo-1; end
8078

8179
# Histogram for each element, radix
8280
for i = lo:hi

Diff for: test/runtests.jl

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
using SortingAlgorithms
2-
using Compat, Compat.Test
2+
using Test
33
using StatsBase
4-
5-
if !isdefined(Base, :invpermute!)
6-
invpermute! = ipermute!
7-
end
4+
using Random
85

96
a = rand(1:10000, 1000)
107

@@ -50,7 +47,7 @@ randnans(n) = reinterpret(Float64,[rand(UInt64)|0x7ff8000000000000 for i=1:n])
5047

5148
function randn_with_nans(n,p)
5249
v = randn(n)
53-
x = find(rand(n).<p)
50+
x = findall(rand(n).<p)
5451
v[x] = randnans(length(x))
5552
return v
5653
end

0 commit comments

Comments
 (0)