[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Findirect_function
From: |
Mattias Engdegård |
Subject: |
Re: [PATCH] Findirect_function |
Date: |
Fri, 14 Jan 2022 13:09:24 +0100 |
14 jan. 2022 kl. 11.40 skrev Manuel Giraud <manuel@ledu-giraud.fr>:
> Maybe it is bike shedding territory (and maybe I'm missing something)
Not at all, patches are always welcome!
> but here are two patches for Findirect_function and its usage. "make
> check" is the same and so far it works for me™.
The first change is straightforward:
> @@ -2380,10 +2380,8 @@ DEFUN ("indirect-function", Findirect_function,
> Sindirect_function, 1, 2, 0,
> if (SYMBOLP (result) && !NILP (result)
> && (result = XSYMBOL (result)->u.s.function, SYMBOLP (result)))
> result = indirect_function (result);
> - if (!NILP (result))
> - return result;
>
> - return Qnil;
> + return result;
Good! See if you can find more instances of this unfortunate pattern. Even if
it makes no difference for the generated code (very likely), it obfuscates the
source code.
The other changes are less obvious since they may introduce extra costs; some
of these code paths are fairly hot. In addition, I'm giving part of the
interpreter an overhaul so perhaps we could drop them for the time being. Do
you agree?