From bb71feaec136824966ae51c5007d11ae2b544c57 Mon Sep 17 00:00:00 2001 From: Eman Resu <78693624+quatquatt@users.noreply.github.com> Date: Thu, 14 May 2026 19:29:25 -0400 Subject: [PATCH] lib.functionArgs: save a function call on every lookup --- lib/trivial.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/trivial.nix b/lib/trivial.nix index 9a7305d500e1..fd48a0456b66 100644 --- a/lib/trivial.nix +++ b/lib/trivial.nix @@ -1101,11 +1101,10 @@ in ``` */ functionArgs = - f: - if f ? __functor then - f.__functionArgs or (functionArgs (f.__functor f)) - else - builtins.functionArgs f; + let + functionArgs = builtins.functionArgs; + in + f: if f ? __functor then f.__functionArgs or (functionArgs (f.__functor f)) else functionArgs f; /** Check whether something is a function or something