We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fa8be6f commit 8ad4716Copy full SHA for 8ad4716
base/abstractarray.jl
@@ -904,9 +904,18 @@ end
904
905
function copyto!(dest::AbstractArray, dstart::Integer, src)
906
i = Int(dstart)
907
- for x in src
908
- dest[i] = x
909
- i += 1
+ if haslength(src)
+ checkbounds(dest, i)
+ checkbounds(dest, i + length(src) - 1)
910
+ for x in src
911
+ @inbounds dest[i] = x
912
+ i += 1
913
+ end
914
+ else
915
916
+ dest[i] = x
917
918
919
end
920
return dest
921
0 commit comments