]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/subr.el (plistp): Simplify (bug#47427).
authorBasil L. Contovounesios <contovob@tcd.ie>
Mon, 27 Jun 2022 20:20:55 +0000 (23:20 +0300)
committerBasil L. Contovounesios <contovob@tcd.ie>
Mon, 27 Jun 2022 20:25:51 +0000 (23:25 +0300)
lisp/subr.el

index 69cff23cba86d1ca179b215cdf422f39be83e5d6..4e4eac32d9d0b4b1a0cbf634750de7e0eade5986 100644 (file)
@@ -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."