From 57e05899936ec12d4faedf1b78ed09b7739f351e Mon Sep 17 00:00:00 2001 From: Shashi Gowda Date: Mon, 27 Mar 2017 11:57:24 +0530 Subject: [PATCH] make master 0.6-only --- REQUIRE | 2 +- src/PooledArrays.jl | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/REQUIRE b/REQUIRE index 70e314a..800cf92 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1 +1 @@ -julia 0.5- +julia 0.6- diff --git a/src/PooledArrays.jl b/src/PooledArrays.jl index dce8040..e3c5ffb 100644 --- a/src/PooledArrays.jl +++ b/src/PooledArrays.jl @@ -22,16 +22,16 @@ immutable PooledArray{T, R<:Integer, N, RA} <: AbstractArray{T, N} refs::RA pool::Vector{T} - function PooledArray(rs::RefArray{RA}, p::Vector{T}) + function (::Type{PooledArray}){T,R,N,RA<:AbstractArray{R, N}}(rs::RefArray{RA}, p::Vector{T}) # refs mustn't overflow pool if length(rs.a) > 0 && maximum(rs.a) > prod(size(p)) throw(ArgumentError("Reference array points beyond the end of the pool")) end - new(rs.a,p) + new{T,R,N,RA}(rs.a,p) end end -typealias PooledVector{T,R} PooledArray{T,R,1} -typealias PooledMatrix{T,R} PooledArray{T,R,2} +const PooledVector{T,R} = PooledArray{T,R,1} +const PooledMatrix{T,R} = PooledArray{T,R,2} ############################################################################## ## @@ -267,7 +267,7 @@ Base.convert(::Type{PooledArray}, a::AbstractArray) = PooledArray(a) function Base.convert{S, T, R, N}(::Type{Array{S, N}}, pa::PooledArray{T, R, N}) - res = Array(S, size(pa)) + res = Array{S}(size(pa)) for i in 1:length(pa) if pa.refs[i] != 0 res[i] = pa.pool[pa.refs[i]]