You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functioncopy!(dst::AbstractVector, src::AbstractVector)
iflength(dst) !=length(src)
resize!(dst, length(src))
endfor i ineachindex(dst, src)
@inbounds dst[i] = src[i]
end
dst
end
while on Julia 1.10 we hit
functioncopy!(dst::AbstractVector, src::AbstractVector)
firstindex(dst) ==firstindex(src) ||throw(ArgumentError(
"vectors must have the same offset for copy! (consider using `copyto!`)"))
iflength(dst) !=length(src)
resize!(dst, length(src))
endcopyto!(dst, src)
end
and eventually
function_copyto_impl!(dest::Array, doffs::Integer, src::Array, soffs::Integer, n::Integer)
n ==0&&return dest
n >0||_throw_argerror("Number of elements to copy must be nonnegative.")
@boundscheckcheckbounds(dest, doffs:doffs+n-1)
@boundscheckcheckbounds(src, soffs:soffs+n-1)
unsafe_copyto!(dest, doffs, src, soffs, n)
return dest
end
where the unsafe_copyto! saves us.
I'm not really certain if this is a "bug" on the end of BangBang.jl or if it's a bug in copy! on Julia 1.7 😕
MWE on Julia 1.7.3
while on Julia 1.10 it works without issues.
It comes down to the usage of
copy!(ys, xs)
hereBangBang.jl/src/NoBang/base.jl
Lines 129 to 137 in cc65483
which, on Julia 1.7 requires
getindex
:while on Julia 1.10 we hit
and eventually
where the
unsafe_copyto!
saves us.I'm not really certain if this is a "bug" on the end of BangBang.jl or if it's a bug in
copy!
on Julia 1.7 😕Manifest.toml
The text was updated successfully, but these errors were encountered: