Mercurial > emacs
diff src/data.c @ 71871:dcd566ed4e9b
(Findirect_function): Optimize for no indirection.
| author | Kim F. Storm <storm@cua.dk> |
|---|---|
| date | Thu, 13 Jul 2006 13:43:44 +0000 |
| parents | d1cea7530d3d |
| children | 7febc7ff0f0d b19aaf4ab0ee |
line wrap: on
line diff
--- a/src/data.c Thu Jul 13 13:43:38 2006 +0000 +++ b/src/data.c Thu Jul 13 13:43:44 2006 +0000 @@ -1913,13 +1913,18 @@ { Lisp_Object result; - result = indirect_function (object); - - if (EQ (result, Qunbound)) - return (NILP (noerror) - ? Fsignal (Qvoid_function, Fcons (object, Qnil)) - : Qnil); - return result; + /* 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 (NILP (noerror)) + Fsignal (Qvoid_function, Fcons (object, Qnil)); + + return Qnil; } /* Extract and set vector and string elements */
