From 774d7c28ad9a8662811b62fb6d821f21f5dbc9c6 Mon Sep 17 00:00:00 2001 From: Jishnu Bhattacharya Date: Fri, 2 Feb 2024 15:57:34 +0530 Subject: [PATCH] Remove short-circuiting in coefficients(Fun, space) --- src/Fun.jl | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/Fun.jl b/src/Fun.jl index d6e875ac..238ca933 100644 --- a/src/Fun.jl +++ b/src/Fun.jl @@ -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))) """