From 99658ecb6860185e0b3fdb8932de3a8b6f7e0f69 Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Fri, 14 Jan 2022 11:29:10 +0100 Subject: [PATCH 2/2] use Findirect_function more. --- src/eval.c | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/src/eval.c b/src/eval.c index 5514583b6a..f72eb6f67a 100644 --- a/src/eval.c +++ b/src/eval.c @@ -2668,14 +2668,10 @@ DEFUN ("apply", Fapply, Sapply, 1, MANY, 0, numargs += nargs - 2; /* Optimize for no indirection. */ - if (SYMBOLP (fun) && !NILP (fun) - && (fun = XSYMBOL (fun)->u.s.function, SYMBOLP (fun))) - { - fun = indirect_function (fun); - if (NILP (fun)) - /* Let funcall get the error. */ - fun = args[0]; - } + fun = Findirect_function(fun, Qt); + if (NILP (fun)) + /* Let funcall get the error. */ + fun = args[0]; if (SUBRP (fun) && XSUBR (fun)->max_args > numargs /* Don't hide an error by adding missing arguments. */ @@ -3069,10 +3065,7 @@ DEFUN ("funcall", Ffuncall, Sfuncall, 1, MANY, 0, retry: /* Optimize for no indirection. */ - fun = original_fun; - if (SYMBOLP (fun) && !NILP (fun) - && (fun = XSYMBOL (fun)->u.s.function, SYMBOLP (fun))) - fun = indirect_function (fun); + fun = Findirect_function(original_fun, Qt); if (SUBRP (fun) && !SUBR_NATIVE_COMPILED_DYNP (fun)) val = funcall_subr (XSUBR (fun), numargs, args + 1); @@ -3388,13 +3381,7 @@ DEFUN ("func-arity", Ffunc_arity, Sfunc_arity, 1, 1, 0, retry: /* Optimize for no indirection. */ - function = original; - if (SYMBOLP (function) && !NILP (function)) - { - function = XSYMBOL (function)->u.s.function; - if (SYMBOLP (function)) - function = indirect_function (function); - } + function = Findirect_function(original, Qt); if (CONSP (function) && EQ (XCAR (function), Qmacro)) function = XCDR (function); -- 2.34.1