emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

scratch/bytecode-speedup a2b4058b96 05/11: Byte code arity check micro-o


From: Mattias Engdegård
Subject: scratch/bytecode-speedup a2b4058b96 05/11: Byte code arity check micro-optimisation
Date: Tue, 11 Jan 2022 11:50:48 -0500 (EST)

branch: scratch/bytecode-speedup
commit a2b4058b96ccbb24b2047cab46517a10d7b4b686
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>

    Byte code arity check micro-optimisation
    
    * src/bytecode.c (exec_byte_code): Slight simplification.
---
 src/bytecode.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/bytecode.c b/src/bytecode.c
index 1561bdc149..2b017f0e8d 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -391,8 +391,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, 
Lisp_Object maxdepth,
       bool rest = (at & 128) != 0;
       int mandatory = at & 127;
       ptrdiff_t nonrest = at >> 8;
-      ptrdiff_t maxargs = rest ? PTRDIFF_MAX : nonrest;
-      if (! (mandatory <= nargs && nargs <= maxargs))
+      if (! (mandatory <= nargs && (rest || nargs <= nonrest)))
        Fsignal (Qwrong_number_of_arguments,
                 list2 (Fcons (make_fixnum (mandatory), make_fixnum (nonrest)),
                        make_fixnum (nargs)));



reply via email to

[Prev in Thread] Current Thread [Next in Thread]