Skip to content

Commit ca247b3

Browse files
mcabbottoxinabox
andcommitted
Apply 3 suggestions
Co-authored-by: Lyndon White <[email protected]>
1 parent c03f25f commit ca247b3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/projection.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ function ProjectTo(xs::AbstractArray)
168168
if elements isa AbstractArray{<:ProjectTo{<:AbstractZero}}
169169
return ProjectTo{NoTangent}() # short-circuit if all elements project to zero
170170
elseif elements isa AbstractArray{<:ProjectTo{Any}}
171-
return ProjectTo{AbstractArray}(; element=ProjectTo(), axes=axes(xs)) # ... or none project
171+
return ProjectTo{AbstractArray}(; element=ProjectTo(), axes=axes(xs)) # ... or all identity projection
172172
else
173173
# Arrays of arrays come here, and will apply projectors individually:
174174
return ProjectTo{AbstractArray}(; elements=elements, axes=axes(xs))
@@ -187,7 +187,7 @@ function (project::ProjectTo{AbstractArray})(dx::AbstractArray{S,M}) where {S,M}
187187
reshape(dx, project.axes)
188188
end
189189
# Then deal with the elements. One projector if AbstractArray{<:Number},
190-
# or one per element for arrays of arrays:
190+
# or one per element for arrays of anything else, including arrays of arrays:
191191
dz = if hasfield(typeof(backing(project)), :element)
192192
T = project_type(project.element)
193193
S <: T ? dy : map(project.element, dy)
@@ -326,7 +326,7 @@ function (project::ProjectTo{SymTridiagonal})(dx::AbstractMatrix)
326326
end
327327
(project::ProjectTo{SymTridiagonal})(dx::SymTridiagonal) = generic_projection(project, dx)
328328

329-
# another strategy is just to use the AbstratArray method
329+
# another strategy is just to use the AbstractArray method
330330
function ProjectTo(x::Tridiagonal{T}) where {T<:Number}
331331
notparent = invoke(ProjectTo, Tuple{AbstractArray{T}} where T<:Number, x)
332332
return ProjectTo{Tridiagonal}(; notparent = notparent)

0 commit comments

Comments
 (0)