Skip to content

Commit

Permalink
Define copy on SubArray to use getindex (JuliaLang#30889)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkborregaard authored and mbauman committed Jan 31, 2019
1 parent 566059b commit 0b0a394
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions base/subarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ similar(V::SubArray, T::Type, dims::Dims) = similar(V.parent, T, dims)

sizeof(V::SubArray) = length(V) * sizeof(eltype(V))

copy(V::SubArray) = V.parent[V.indices...]

parent(V::SubArray) = V.parent
parentindices(V::SubArray) = V.indices

Expand Down

0 comments on commit 0b0a394

Please sign in to comment.