Skip to content

Commit 9dc6142

Browse files
committed
fix final type uncertainty
1 parent 50dfd23 commit 9dc6142

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

base/abstractarray.jl

+3-4
Original file line numberDiff line numberDiff line change
@@ -1054,10 +1054,9 @@ function sub2ind{T<:Integer}(dims::Tuple{Vararg{Integer}}, I::AbstractVector{T}.
10541054
return indices
10551055
end
10561056

1057-
function ind2sub{T<:Integer}(dims::Tuple{Vararg{Integer}}, ind::AbstractVector{T})
1058-
N = length(dims)
1057+
function ind2sub{N,T<:Integer}(dims::NTuple{N,Integer}, ind::AbstractVector{T})
10591058
M = length(ind)
1060-
t = [Array{T}(M) for j=1:N]
1059+
t = NTuple{N,Vector{T}}(ntuple(N,n->Array{T}(M)))
10611060
copy!(t[1],ind)
10621061
for j = 1:N-1
10631062
d = dims[j]
@@ -1069,7 +1068,7 @@ function ind2sub{T<:Integer}(dims::Tuple{Vararg{Integer}}, ind::AbstractVector{T
10691068
tj2[i] = ind2+1
10701069
end
10711070
end
1072-
return tuple(t...)
1071+
return t
10731072
end
10741073

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

0 commit comments

Comments
 (0)