]> git.eshelyaron.com Git - emacs.git/commitdiff
(Findirect_function): Optimize for no indirection.
authorKim F. Storm <storm@cua.dk>
Thu, 13 Jul 2006 13:43:44 +0000 (13:43 +0000)
committerKim F. Storm <storm@cua.dk>
Thu, 13 Jul 2006 13:43:44 +0000 (13:43 +0000)
src/data.c

index 0b46fceb2982add815317757e35e2173a154706e..f715be56cee5eca996e84a6180a2882002471ba7 100644 (file)
@@ -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;
 }
 \f
 /* Extract and set vector and string elements */