Skip to content

Commit

Permalink
Remove short-circuiting in coefficients(Fun, space)
Browse files Browse the repository at this point in the history
  • Loading branch information
jishnub committed Feb 2, 2024
1 parent 5b6c8d0 commit 774d7c2
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/Fun.jl
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,7 @@ julia> coefficients(f, Legendre()) ≈ [0, 0, 1]
true
```
"""
function coefficients(f::Fun,msp::Space)
#zero can always be converted
fc = f.coefficients
if ncoefficients(f) == 0 || (ncoefficients(f) == 1 && fc[1] == 0)
convert(Vector, fc)
else
coefficients(fc, space(f), msp)
end
end
coefficients(f::Fun, msp::Space) = coefficients(coefficients(f), space(f), msp)
coefficients(f::Fun,::Type{T}) where {T<:Space} = coefficients(f,T(domain(f)))

"""
Expand Down

0 comments on commit 774d7c2

Please sign in to comment.