]> git.eshelyaron.com Git - emacs.git/commitdiff
Prefer `(defsubst A ...)` to `(cl-proclaim (inline A))`
authorStefan Kangas <stefankangas@gmail.com>
Fri, 14 Feb 2025 23:40:52 +0000 (00:40 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sat, 15 Feb 2025 19:31:12 +0000 (20:31 +0100)
* lisp/emacs-lisp/cl-macs.el: Remove cl-proclaim...
* lisp/emacs-lisp/cl-extra.el (cl-map, cl-notany, cl-notevery)
(cl-revappend, cl-nreconc):
* lisp/emacs-lisp/cl-lib.el (cl-acons): ...and use defsubst
instead.  (Bug#76294)

(cherry picked from commit dc86f59e926f618d4e3568a332b42ea0647a08ba)

lisp/emacs-lisp/cl-extra.el
lisp/emacs-lisp/cl-lib.el
lisp/emacs-lisp/cl-macs.el

index 92236519a47df363ff9368f6efb1358ffcd4cc3c..ec7dc5aa9e3b869f802b4c7e7c292817e922b3f5 100644 (file)
@@ -127,7 +127,7 @@ strings case-insensitively."
        (and acc (nreverse cl-res)))))
 
 ;;;###autoload
-(defun cl-map (cl-type cl-func cl-seq &rest cl-rest)
+(defsubst cl-map (cl-type cl-func cl-seq &rest cl-rest)
   "Map a FUNCTION across one or more SEQUENCEs, returning a sequence.
 TYPE is the sequence type to return.
 \n(fn TYPE FUNCTION SEQUENCE...)"
@@ -239,14 +239,14 @@ non-nil value.
     (null cl-seq)))
 
 ;;;###autoload
-(defun cl-notany (cl-pred cl-seq &rest cl-rest)
+(defsubst cl-notany (cl-pred cl-seq &rest cl-rest)
   "Return true if PREDICATE is false of every element of SEQ or SEQs.
 \n(fn PREDICATE SEQ...)"
   (declare (important-return-value t))
   (not (apply #'cl-some cl-pred cl-seq cl-rest)))
 
 ;;;###autoload
-(defun cl-notevery (cl-pred cl-seq &rest cl-rest)
+(defsubst cl-notevery (cl-pred cl-seq &rest cl-rest)
   "Return true if PREDICATE is false of some element of SEQ or SEQs.
 \n(fn PREDICATE SEQ...)"
   (declare (important-return-value t))
@@ -589,13 +589,13 @@ too large if positive or too small if negative)."
 ;;; List functions.
 
 ;;;###autoload
-(defun cl-revappend (x y)
+(defsubst cl-revappend (x y)
   "Equivalent to (append (reverse X) Y)."
   (declare (side-effect-free t))
   (nconc (reverse x) y))
 
 ;;;###autoload
-(defun cl-nreconc (x y)
+(defsubst cl-nreconc (x y)
   "Equivalent to (nconc (nreverse X) Y)."
   (declare (important-return-value t))
   (nconc (nreverse x) y))
index 7cd6e8a797853b8a3054430ff6e15435d663cf96..38339ca10d46b5a545d9cec5ee8087e675ddfc94 100644 (file)
@@ -527,7 +527,7 @@ Return a copy of TREE with all elements `eql' to OLD replaced by NEW.
               cl-tree (cons a d))))
        (t cl-tree)))
 
-(defun cl-acons (key value alist)
+(defsubst cl-acons (key value alist)
   "Add KEY and VALUE to ALIST.
 Return a new list with (cons KEY VALUE) as car and ALIST as cdr."
   (declare (side-effect-free error-free))
index a40d12fdbd3b3ccba4b7240c3505ef66e27d2c88..eada5cf3cb91b59a50990a41d8ba5a5b3c913623 100644 (file)
@@ -3725,10 +3725,6 @@ macro that returns its `&whole' argument."
       `(cl-getf (symbol-plist ,sym) ,prop ,def)
     `(get ,sym ,prop)))
 
-;;; Things that are inline.
-(cl-proclaim '(inline cl-acons cl-map cl-notany cl-notevery cl-revappend
-               cl-nreconc))
-
 ;;; Types and assertions.
 
 ;;;###autoload