Skip to content

Commit

Permalink
add special cases for constant propagation
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Jul 5, 2024
1 parent 09ee6ec commit 42a1e3e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions base/operators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1196,6 +1196,10 @@ function (f::Fix{N})(args::Vararg{Any,M}; kws...) where {N,M}
end
end

# Special cases for improved constant propagation
(f::Fix{1})(arg; kws...) = f.f(f.x, arg; kws...)
(f::Fix{2})(arg; kws...) = f.f(arg, f.x; kws...)

"""
Alias for `Fix{1}`. See [`Fix`](@ref Base.Fix).
"""
Expand Down

0 comments on commit 42a1e3e

Please sign in to comment.