1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Prefer '(oddp A)' to '(= 1 (logand A 1))'

* lisp/calendar/todo-mode.el (todo-padded-string):
* lisp/emacs-lisp/gv.el (setf):
* lisp/emacs-lisp/macroexp.el (macroexp--expand-all):
* lisp/hexl.el (hexl-insert-hex-string):
* lisp/play/gamegrid.el (gamegrid-xbm):
* lisp/play/hanoi.el (hanoi-internal):
* lisp/progmodes/ebnf2ps.el (ebnf-end-of-string):
* lisp/progmodes/elisp-mode.el (elisp--highlight-function-argument):
* lisp/progmodes/ruby-mode.el (ruby-backward-sexp):
* lisp/ps-print.el (ps-print-page-p):
(ps-print-sheet-p): Prefer '(oddp A)' to '(= 1 (logand A 1))' and
variations thereof.
This commit is contained in:
Stefan Kangas 2025-02-17 19:33:56 +01:00
parent 7c7cf3e8c8
commit fd5dbea21b
10 changed files with 13 additions and 16 deletions

View file

@ -435,7 +435,7 @@ Assumes the caller has bound `macroexpand-all-environment'."
;; Malformed code is translated to code that signals an error
;; at run time.
(let ((nargs (length args)))
(if (/= (logand nargs 1) 0)
(if (oddp nargs)
(macroexp-warn-and-return
(format-message "odd number of arguments in `setq' form")
`(signal 'wrong-number-of-arguments '(setq ,nargs))