lib.functionArgs: save a function call on every lookup

This commit is contained in:
Eman Resu
2026-05-14 19:29:25 -04:00
parent 77334757d7
commit bb71feaec1

View File

@@ -1101,11 +1101,10 @@ in
``` ```
*/ */
functionArgs = functionArgs =
f: let
if f ? __functor then functionArgs = builtins.functionArgs;
f.__functionArgs or (functionArgs (f.__functor f)) in
else f: if f ? __functor then f.__functionArgs or (functionArgs (f.__functor f)) else functionArgs f;
builtins.functionArgs f;
/** /**
Check whether something is a function or something Check whether something is a function or something