Skip to content

Commit

Permalink
Use CartesianRange instead of cartesianmap. Fixes #38.
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasnoack committed Sep 3, 2015
1 parent fa44a13 commit 345e811
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/DistributedArrays.jl
Expand Up @@ -197,8 +197,8 @@ function chunk_idxs(dims, chunks)
cuts = map(defaultdist, dims, chunks)
n = length(dims)
idxs = Array(NTuple{n,UnitRange{Int}},chunks...)
cartesianmap(tuple(chunks...)) do cidx...
idxs[cidx...] = ntuple(i -> (cuts[i][cidx[i]]:cuts[i][cidx[i] + 1] - 1), n)
for cidx in CartesianRange(tuple(chunks...))
idxs[cidx.I...] = ntuple(i -> (cuts[i][cidx[i]]:cuts[i][cidx[i] + 1] - 1), n)
end
return (idxs, cuts)
end
Expand Down

0 comments on commit 345e811

Please sign in to comment.