@@ -11,14 +11,14 @@ const BadArgs = Args{<:Tuple{Tuple{<:Tuple}}}
11
11
12
12
# Some help functions.
13
13
@pure has_ndims (:: Type{<:StaticArray{<:Tuple,<:Any,N}} ) where {N} = @isdefined N
14
- @pure has_ndims (:: Type{<:StaticArray} ) = false
14
+ has_ndims (:: Type{<:StaticArray} ) = false
15
15
if VERSION < v " 1.7"
16
16
Base. ndims (:: Type{<:StaticArray{<:Tuple,<:Any,N}} ) where {N} = N
17
17
end
18
18
@pure has_eltype (:: Type{<:StaticArray{<:Tuple,T}} ) where {T} = @isdefined T
19
- @pure has_eltype (:: Type{<:StaticArray} ) = false
19
+ has_eltype (:: Type{<:StaticArray} ) = false
20
20
@pure has_size (:: Type{<:StaticArray{S}} ) where {S<: Tuple } = @isdefined S
21
- @pure has_size (:: Type{<:StaticArray} ) = false
21
+ has_size (:: Type{<:StaticArray} ) = false
22
22
# workaround for https://github.com/JuliaArrays/StaticArrays.jl/issues/1047
23
23
has_size (:: Type{SVector} ) = false
24
24
has_size (:: Type{MVector} ) = false
@@ -28,10 +28,10 @@ has_size(::Type{SMatrix{N}}) where {N} = false
28
28
has_size (:: Type{MMatrix{N}} ) where {N} = false
29
29
30
30
@pure has_size1 (:: Type{<:StaticMatrix{M}} ) where {M} = @isdefined M
31
- @pure has_size1 (:: Type{<:StaticMatrix} ) = false
31
+ has_size1 (:: Type{<:StaticMatrix} ) = false
32
32
_size1 (:: Type{<:StaticMatrix{M}} ) where {M} = M
33
33
@generated function _sqrt (:: Length{L} ) where {L}
34
- N = round (Int, sqrt (L) )
34
+ N = isqrt (L )
35
35
N^ 2 == L && return :($ N)
36
36
throw (DimensionMismatch (" Input's length must be perfect square" ))
37
37
end
0 commit comments