From 51d3d65a4f20fc645a0b1e660047b16478d593b8 Mon Sep 17 00:00:00 2001 From: Marcus Huntemann Date: Wed, 19 Apr 2023 10:24:34 +0200 Subject: [PATCH] improve type stability with StaticArrays Replace an anonymous function with Base.Fix1 for type stability in some cases, see #639 --- ext/ForwardDiffStaticArraysExt.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ForwardDiffStaticArraysExt.jl b/ext/ForwardDiffStaticArraysExt.jl index 52914cd6..fae5b0b0 100644 --- a/ext/ForwardDiffStaticArraysExt.jl +++ b/ext/ForwardDiffStaticArraysExt.jl @@ -105,7 +105,7 @@ end T = typeof(Tag(f, eltype(x))) ydual = static_dual_eval(T, f, x) result = DiffResults.jacobian!(result, extract_jacobian(T, ydual, x)) - result = DiffResults.value!(d -> value(T,d), result, ydual) + result = DiffResults.value!(Base.Fix1(value,T), result, ydual) return result end