Skip to content

Commit

Permalink
make master 0.6-only
Browse files Browse the repository at this point in the history
  • Loading branch information
Shashi Gowda committed Mar 27, 2017
1 parent 69b19a6 commit 57e0589
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
julia 0.5-
julia 0.6-
10 changes: 5 additions & 5 deletions src/PooledArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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}

##############################################################################
##
Expand Down Expand Up @@ -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]]
Expand Down

0 comments on commit 57e0589

Please sign in to comment.