From 64de53d81bc8ebdafaafbe377de0a941b53c2e8c Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Thu, 13 Jul 2006 13:43:44 +0000 Subject: [PATCH] (Findirect_function): Optimize for no indirection. --- src/data.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/data.c b/src/data.c index 0b46fceb298..f715be56cee 100644 --- a/src/data.c +++ b/src/data.c @@ -1913,13 +1913,18 @@ function chain of symbols. */) { Lisp_Object result; - result = indirect_function (object); + /* Optimize for no indirection. */ + result = object; + if (SYMBOLP (result) && !EQ (result, Qunbound) + && (result = XSYMBOL (result)->function, SYMBOLP (result))) + result = indirect_function (result); + if (!EQ (result, Qunbound)) + return result; - if (EQ (result, Qunbound)) - return (NILP (noerror) - ? Fsignal (Qvoid_function, Fcons (object, Qnil)) - : Qnil); - return result; + if (NILP (noerror)) + Fsignal (Qvoid_function, Fcons (object, Qnil)); + + return Qnil; } /* Extract and set vector and string elements */ -- 2.39.2