Skip to content

Commit 2a7518e

Browse files
committed
Limit to Array views
1 parent 4906add commit 2a7518e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/generic.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2020,8 +2020,9 @@ function isapprox(x::AbstractArray, y::AbstractArray;
20202020
end
20212021

20222022
norm_x_minus_y(x, y) = norm(x - y)
2023-
const ArrayOrFastContiguousSubArrayStrided = Union{Array, FastContiguousSubArrayStrided}
2024-
function norm_x_minus_y(x::ArrayOrFastContiguousSubArrayStrided, y::ArrayOrFastContiguousSubArrayStrided)
2023+
FastContiguousArrayView{T,N,P<:Array,I<:Tuple{AbstractUnitRange, Vararg{Any}}} = Base.SubArray{T,N,P,I,true}
2024+
const ArrayOrFastContiguousArrayView = Union{Array, FastContiguousArrayView}
2025+
function norm_x_minus_y(x::ArrayOrFastContiguousArrayView, y::ArrayOrFastContiguousArrayView)
20252026
norm(Iterators.map(splat(-), zip(x,y)))
20262027
end
20272028

0 commit comments

Comments
 (0)