Skip to content

Commit

Permalink
fix final type uncertainty
Browse files Browse the repository at this point in the history
  • Loading branch information
Jutho committed May 1, 2015
1 parent 50dfd23 commit 9dc6142
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1054,10 +1054,9 @@ function sub2ind{T<:Integer}(dims::Tuple{Vararg{Integer}}, I::AbstractVector{T}.
return indices
end

function ind2sub{T<:Integer}(dims::Tuple{Vararg{Integer}}, ind::AbstractVector{T})
N = length(dims)
function ind2sub{N,T<:Integer}(dims::NTuple{N,Integer}, ind::AbstractVector{T})
M = length(ind)
t = [Array{T}(M) for j=1:N]
t = NTuple{N,Vector{T}}(ntuple(N,n->Array{T}(M)))
copy!(t[1],ind)
for j = 1:N-1
d = dims[j]
Expand All @@ -1069,7 +1068,7 @@ function ind2sub{T<:Integer}(dims::Tuple{Vararg{Integer}}, ind::AbstractVector{T
tj2[i] = ind2+1
end
end
return tuple(t...)
return t
end

function ind2sub!{T<:Integer}(sub::Array{T}, dims::Tuple{Vararg{T}}, ind::T)
Expand Down

0 comments on commit 9dc6142

Please sign in to comment.