mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-03 18:41:25 -08:00
func-arity minor improvements
* src/bytecode.c (get_byte_code_arity): Omit unnecessary runtime test for integer argument, unless debugging. Use EMACS_INT for Emacs integers. * src/eval.c (Ffunc_arity): Omit unused locals. Avoid side effects in ‘if’ expr. (lambda_arity): Use bool for boolean, and EMACS_INT for Emacs ints.
This commit is contained in:
parent
efb1883244
commit
bc9cc21d34
2 changed files with 18 additions and 22 deletions
|
|
@ -1991,18 +1991,14 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
|
|||
Lisp_Object
|
||||
get_byte_code_arity (Lisp_Object args_template)
|
||||
{
|
||||
if (INTEGERP (args_template))
|
||||
{
|
||||
ptrdiff_t at = XINT (args_template);
|
||||
bool rest = (at & 128) != 0;
|
||||
int mandatory = at & 127;
|
||||
ptrdiff_t nonrest = at >> 8;
|
||||
eassert (NATNUMP (args_template));
|
||||
EMACS_INT at = XINT (args_template);
|
||||
bool rest = (at & 128) != 0;
|
||||
int mandatory = at & 127;
|
||||
EMACS_INT nonrest = at >> 8;
|
||||
|
||||
return Fcons (make_number (mandatory),
|
||||
rest ? Qmany : make_number (nonrest));
|
||||
}
|
||||
else
|
||||
error ("Unknown args template!");
|
||||
return Fcons (make_number (mandatory),
|
||||
rest ? Qmany : make_number (nonrest));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue