@@ -47,7 +47,9 @@ function checked_dims_impl(a::Int, t::Tuple{Int,Vararg{Int,N}}) where {N}
47
47
throw (ArgumentError (" array dimension size can't be negative" ))
48
48
end
49
49
(m, o) = Base. Checked. mul_with_overflow (a, b)
50
- o && throw (ArgumentError (" array dimensions too great, can't represent length" ))
50
+ if o
51
+ throw (ArgumentError (" array dimensions too great, can't represent length" ))
52
+ end
51
53
r = Base. tail (t):: NTuple{N,Int}
52
54
checked_dims_impl (m, r):: Int
53
55
end
@@ -85,8 +87,9 @@ axes_are_one_based(axes) = all(isone ∘ first, axes)
85
87
86
88
function FixedSizeArray {T,N} (src:: AbstractArray{S,N} ) where {T,N,S}
87
89
axs = axes (src)
88
- axes_are_one_based (axs) ||
90
+ if ! axes_are_one_based (axs)
89
91
throw (DimensionMismatch (" source array has a non-one-based indexing axis" ))
92
+ end
90
93
# Can't use `Base.size` because, according to it's doc string, it's not
91
94
# available for all `AbstractArray` types.
92
95
size = map (length, axs)
@@ -107,8 +110,9 @@ Base.convert(::Type{T}, a::AbstractArray) where {T<:FixedSizeArray} = T(a)::T
107
110
108
111
Base. @propagate_inbounds function copyto5! (dst, doff, src, soff, n)
109
112
if ! iszero (n)
110
- ( n < false ) &&
113
+ if n < false
111
114
throw (ArgumentError (" the number of elements to copy must be nonnegative" ))
115
+ end
112
116
@boundscheck checkbounds (dst, doff: doff+ n- 1 )
113
117
@boundscheck checkbounds (src, soff: soff+ n- 1 )
114
118
@inbounds let d, s
0 commit comments