@@ -914,19 +914,21 @@ end
914914# copy from an some iterable object into an AbstractArray
915915function copyto! (dest:: AbstractArray , dstart:: Integer , src, sstart:: Integer )
916916 if (sstart < 1 )
917- throw (ArgumentError (string (" source start offset (" ,sstart," ) is < 1" )))
917+ throw (ArgumentError (LazyString (" source start offset (" ,sstart," ) is < 1" )))
918918 end
919919 y = iterate (src)
920920 for j = 1 : (sstart- 1 )
921921 if y === nothing
922- throw (ArgumentError (string (" source has fewer elements than required, " ,
923- " expected at least " ,sstart," , got " ,j- 1 )))
922+ throw (ArgumentError (LazyString (
923+ " source has fewer elements than required, " ,
924+ " expected at least " , sstart," , got " , j- 1 )))
924925 end
925926 y = iterate (src, y[2 ])
926927 end
927928 if y === nothing
928- throw (ArgumentError (string (" source has fewer elements than required, " ,
929- " expected at least " ,sstart," , got " ,sstart- 1 )))
929+ throw (ArgumentError (LazyString (
930+ " source has fewer elements than required, " ,
931+ " expected at least " ,sstart," got " , sstart- 1 )))
930932 end
931933 i = Int (dstart)
932934 while y != = nothing
@@ -940,19 +942,22 @@ end
940942
941943# this method must be separate from the above since src might not have a length
942944function copyto! (dest:: AbstractArray , dstart:: Integer , src, sstart:: Integer , n:: Integer )
943- n < 0 && throw (ArgumentError (string (" tried to copy n=" , n, " elements, but n should be nonnegative" )))
945+ n < 0 && throw (ArgumentError (LazyString (" tried to copy n=" ,n,
946+ " , elements, but n should be nonnegative" )))
944947 n == 0 && return dest
945948 dmax = dstart + n - 1
946949 inds = LinearIndices (dest)
947950 if (dstart ∉ inds || dmax ∉ inds) | (sstart < 1 )
948- sstart < 1 && throw (ArgumentError (string (" source start offset (" ,sstart," ) is < 1" )))
951+ sstart < 1 && throw (ArgumentError (LazyString (" source start offset (" ,
952+ sstart," ) is < 1" )))
949953 throw (BoundsError (dest, dstart: dmax))
950954 end
951955 y = iterate (src)
952956 for j = 1 : (sstart- 1 )
953957 if y === nothing
954- throw (ArgumentError (string (" source has fewer elements than required, " ,
955- " expected at least " ,sstart," , got " ,j- 1 )))
958+ throw (ArgumentError (LazyString (
959+ " source has fewer elements than required, " ,
960+ " expected at least " ,sstart," , got " ,j- 1 )))
956961 end
957962 y = iterate (src, y[2 ])
958963 end
@@ -1064,7 +1069,8 @@ function copyto!(dest::AbstractArray, dstart::Integer,
10641069 src:: AbstractArray , sstart:: Integer ,
10651070 n:: Integer )
10661071 n == 0 && return dest
1067- n < 0 && throw (ArgumentError (string (" tried to copy n=" , n, " elements, but n should be nonnegative" )))
1072+ n < 0 && throw (ArgumentError (LazyString (" tried to copy n=" ,
1073+ n," elements, but n should be nonnegative" )))
10681074 destinds, srcinds = LinearIndices (dest), LinearIndices (src)
10691075 (checkbounds (Bool, destinds, dstart) && checkbounds (Bool, destinds, dstart+ n- 1 )) || throw (BoundsError (dest, dstart: dstart+ n- 1 ))
10701076 (checkbounds (Bool, srcinds, sstart) && checkbounds (Bool, srcinds, sstart+ n- 1 )) || throw (BoundsError (src, sstart: sstart+ n- 1 ))
@@ -1082,12 +1088,12 @@ end
10821088function copyto! (B:: AbstractVecOrMat{R} , ir_dest:: AbstractRange{Int} , jr_dest:: AbstractRange{Int} ,
10831089 A:: AbstractVecOrMat{S} , ir_src:: AbstractRange{Int} , jr_src:: AbstractRange{Int} ) where {R,S}
10841090 if length (ir_dest) != length (ir_src)
1085- throw (ArgumentError (string (" source and destination must have same size (got " ,
1086- length (ir_src)," and " ,length (ir_dest)," )" )))
1091+ throw (ArgumentError (LazyString (" source and destination must have same size (got " ,
1092+ length (ir_src)," and " ,length (ir_dest)," )" )))
10871093 end
10881094 if length (jr_dest) != length (jr_src)
1089- throw (ArgumentError (string (" source and destination must have same size (got " ,
1090- length (jr_src)," and " ,length (jr_dest)," )" )))
1095+ throw (ArgumentError (LazyString (" source and destination must have same size (got " ,
1096+ length (jr_src)," and " ,length (jr_dest)," )" )))
10911097 end
10921098 @boundscheck checkbounds (B, ir_dest, jr_dest)
10931099 @boundscheck checkbounds (A, ir_src, jr_src)
0 commit comments