From: Basil L. Contovounesios Date: Mon, 27 Jun 2022 20:20:55 +0000 (+0300) Subject: * lisp/subr.el (plistp): Simplify (bug#47427). X-Git-Tag: emacs-29.0.90~1447^2~1417 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7565dfd268671c8d5388e8b9fe823367c206c131;p=emacs.git * lisp/subr.el (plistp): Simplify (bug#47427). --- diff --git a/lisp/subr.el b/lisp/subr.el index 69cff23cba8..4e4eac32d9d 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -4008,9 +4008,8 @@ Otherwise, return nil." (defun plistp (object) "Non-nil if and only if OBJECT is a valid plist." - (and (listp object) - (proper-list-p object) - (zerop (mod (length object) 2)))) + (let ((len (proper-list-p object))) + (and len (zerop (% len 2))))) (defun macrop (object) "Non-nil if and only if OBJECT is a macro."