summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKim F. Storm <storm@cua.dk>2006-07-13 13:43:44 +0000
committerKim F. Storm <storm@cua.dk>2006-07-13 13:43:44 +0000
commit64de53d81bc8ebdafaafbe377de0a941b53c2e8c (patch)
tree7616acf4a61058e583da7930399a452130c4d8fa /src
parent14c5155a18934ab22c052886978661abe0a259df (diff)
downloademacs-64de53d81bc8ebdafaafbe377de0a941b53c2e8c.tar.gz
(Findirect_function): Optimize for no indirection.
Diffstat (limited to 'src')
-rw-r--r--src/data.c17
1 files 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 */