]> git.eshelyaron.com Git - emacs.git/commitdiff
Consolidate side-effect-free decls in cl-lib
authorStefan Kangas <stefankangas@gmail.com>
Wed, 12 Feb 2025 18:55:34 +0000 (19:55 +0100)
committerEshel Yaron <me@eshelyaron.com>
Thu, 13 Feb 2025 11:52:48 +0000 (12:52 +0100)
* lisp/emacs-lisp/cl-macs.el: Consolidate two identical loops with
side-effect-free declarations into one.

(cherry picked from commit b93cdeb04769fde8e553a03ed4c68b442f9c43b4)

lisp/emacs-lisp/cl-macs.el

index 8dc5b81d32dc553048f73b61d9aca88e5ad9622e..7185b20d65105fc0b3f8dd5b2c4d21672ec7e913 100644 (file)
@@ -3725,19 +3725,17 @@ macro that returns its `&whole' argument."
       `(cl-getf (symbol-plist ,sym) ,prop ,def)
     `(get ,sym ,prop)))
 
-(dolist (y '(cl-first cl-second cl-third cl-fourth
-             cl-fifth cl-sixth cl-seventh
-             cl-eighth cl-ninth cl-tenth
-             cl-rest cl-endp cl-plusp cl-minusp))
-  (put y 'side-effect-free t))
-
 ;;; Things that are inline.
 (cl-proclaim '(inline cl-acons cl-map cl-notany cl-notevery cl-revappend
                cl-nreconc))
 
 ;;; Things that are side-effect-free.
 (mapc (lambda (x) (function-put x 'side-effect-free t))
-      '(cl-oddp cl-evenp cl-signum cl-ldiff cl-pairlis cl-gcd
+      '(cl-first cl-second cl-third cl-fourth
+        cl-fifth cl-sixth cl-seventh
+        cl-eighth cl-ninth cl-tenth
+        cl-rest cl-endp cl-plusp cl-minusp
+        cl-oddp cl-evenp cl-signum cl-ldiff cl-pairlis cl-gcd
         cl-lcm cl-isqrt cl-floor cl-ceiling cl-truncate cl-round cl-mod cl-rem
         cl-subseq cl-list-length cl-get cl-getf))