From ee4b2253fba95762a4f5d734205fa338f1c98edb Mon Sep 17 00:00:00 2001 From: Gaurav Arya Date: Tue, 22 Aug 2023 17:24:20 -0400 Subject: [PATCH] Fix another type instability --- src/definitions.jl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/definitions.jl b/src/definitions.jl index eb68e88..efead20 100644 --- a/src/definitions.jl +++ b/src/definitions.jl @@ -683,12 +683,11 @@ function adjoint_mul(p::Plan{T}, x::AbstractArray, ::FFTAdjointStyle) where {T} pinv = inv(p) # Optimization: when pinv is a ScaledPlan, check if we can avoid a loop over x. # Even if not, ensure that we do only one pass by combining the normalization with the plan. - scaled_pinv = if pinv isa ScaledPlan && isapprox(pinv.scale, N) - pinv.p + if pinv isa ScaledPlan && isapprox(pinv.scale, N) + return pinv.p * x else - (1/N) * pinv + return (1/N * pinv) * x end - return scaled_pinv * x end function adjoint_mul(p::Plan{T}, x::AbstractArray, ::RFFTAdjointStyle) where {T<:Real}