File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -179,13 +179,12 @@ end
179
179
180
180
# For arrays of numbers, just store one projector:
181
181
function ProjectTo (x:: AbstractArray{T} ) where {T<: Number }
182
- element = T <: Irrational ? ProjectTo {Real} () : ProjectTo (zero (T))
183
- if element isa ProjectTo{<: AbstractZero }
184
- return ProjectTo {NoTangent} () # short-circuit if all elements project to zero
185
- else
186
- return ProjectTo {AbstractArray} (; element= element, axes= axes (x))
187
- end
182
+ return ProjectTo {AbstractArray} (; element= _eltype_projectto (T), axes= axes (x))
188
183
end
184
+ ProjectTo (x:: AbstractArray{Bool} ) = ProjectTo {NoTangent} ()
185
+
186
+ _eltype_projectto (:: Type{T} ) where {T<: Number } = ProjectTo (zero (T))
187
+ _eltype_projectto (:: Type{<:Irrational} ) = ProjectTo {Real} ()
189
188
190
189
# In other cases, store a projector per element:
191
190
function ProjectTo (xs:: AbstractArray )
You can’t perform that action at this time.
0 commit comments