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

Prefer incf to cl-incf in emacs-lisp/*.el

* lisp/emacs-lisp/backtrace.el (backtrace--print-func-and-args):
* lisp/emacs-lisp/bindat.el (bindat--type):
* lisp/emacs-lisp/bytecomp.el (byte-recompile-directory):
* lisp/emacs-lisp/chart.el (chart-file-count):
* lisp/emacs-lisp/cl-extra.el (cl-parse-integer, cl--print-table):
* lisp/emacs-lisp/cl-generic.el (cl--defmethod-doc-pos):
* lisp/emacs-lisp/cl-indent.el (common-lisp-loop-part-indentation)
(common-lisp-indent-function-1, lisp-indent-defmethod):
* lisp/emacs-lisp/cl-lib.el (cl--set-substring):
* lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause):
* lisp/emacs-lisp/cl-preloaded.el (cl-struct-define):
* lisp/emacs-lisp/cl-print.el (cl-print--cons-tail)
(cl-print--vector-contents, cl-print--struct-contents)
(cl-print--string-props):
* lisp/emacs-lisp/cl-seq.el (cl-substitute):
* lisp/emacs-lisp/comp-cstr.el (comp--range-union)
(comp--range-intersection):
* lisp/emacs-lisp/comp.el (comp-vec-append, comp--gen-counter)
(comp--op-case, comp--limplify-lap-inst, comp--limplify-block)
(comp--limplify-function, comp--maybe-add-vmvar, comp--fwprop*):
* lisp/emacs-lisp/edebug.el (edebug--called-interactively-skip):
* lisp/emacs-lisp/eldoc.el (eldoc--invoke-strategy):
* lisp/emacs-lisp/elp.el (elp--make-wrapper):
* lisp/emacs-lisp/ert-x.el (ert-kill-all-test-buffers):
* lisp/emacs-lisp/ert.el (ert--stats-set-test-and-result)
(ert-write-junit-test-summary-report):
* lisp/emacs-lisp/memory-report.el (memory-report--symbol-plist)
(memory-report--object-size-1):
* lisp/emacs-lisp/oclosure.el (oclosure--index-table)
(oclosure--define-functions):
* lisp/emacs-lisp/package.el (package-menu--perform-transaction):
* lisp/emacs-lisp/smie.el (smie-set-prec2tab, smie-prec2->grammar)
(smie-config--guess, smie-config--guess-1):
* lisp/emacs-lisp/syntax.el (syntax-propertize-rules)
(syntax-ppss--update-stats):
* lisp/emacs-lisp/track-changes.el (track-changes--after): Prefer incf
to cl-incf.
This commit is contained in:
Stefan Kangas 2025-02-23 00:13:21 +01:00
parent 042dc5929b
commit ae37a1cc3d
25 changed files with 97 additions and 97 deletions

View file

@ -682,7 +682,7 @@ is the name of a variable that will hold the value we need to pack.")
(cl-defmethod bindat--type (op (_ (eql 'byte)))
(bindat--pcase op
('unpack `(bindat--unpack-u8))
(`(length . ,_) `(cl-incf bindat-idx 1))
(`(length . ,_) `(incf bindat-idx 1))
(`(pack . ,args) `(bindat--pack-u8 . ,args))))
(cl-defmethod bindat--type (op (_ (eql 'uint)) n &optional le)
@ -690,7 +690,7 @@ is the name of a variable that will hold the value we need to pack.")
(bindat--pcase op
('unpack
`(if ,le (bindat--unpack-uintr ,n) (bindat--unpack-uint ,n)))
(`(length . ,_) `(cl-incf bindat-idx (/ ,n 8)))
(`(length . ,_) `(incf bindat-idx (/ ,n 8)))
(`(pack . ,args)
`(if ,le (bindat--pack-uintr ,n . ,args)
(bindat--pack-uint ,n . ,args))))))
@ -698,14 +698,14 @@ is the name of a variable that will hold the value we need to pack.")
(cl-defmethod bindat--type (op (_ (eql 'str)) len)
(bindat--pcase op
('unpack `(bindat--unpack-str ,len))
(`(length . ,_) `(cl-incf bindat-idx ,len))
(`(length . ,_) `(incf bindat-idx ,len))
(`(pack . ,args) `(bindat--pack-str ,len . ,args))))
(cl-defmethod bindat--type (op (_ (eql 'strz)) &optional len)
(bindat--pcase op
('unpack `(bindat--unpack-strz ,len))
(`(length ,val)
`(cl-incf bindat-idx ,(cond
`(incf bindat-idx ,(cond
;; Optimizations if len is a literal number or nil.
((null len) `(1+ (length ,val)))
((numberp len) len)
@ -716,11 +716,11 @@ is the name of a variable that will hold the value we need to pack.")
(cl-defmethod bindat--type (op (_ (eql 'bits)) len)
(bindat--pcase op
('unpack `(bindat--unpack-bits ,len))
(`(length . ,_) `(cl-incf bindat-idx ,len))
(`(length . ,_) `(incf bindat-idx ,len))
(`(pack . ,args) `(bindat--pack-bits ,len . ,args))))
(cl-defmethod bindat--type (_op (_ (eql 'fill)) len)
`(progn (cl-incf bindat-idx ,len) nil))
`(progn (incf bindat-idx ,len) nil))
(cl-defmethod bindat--type (_op (_ (eql 'align)) len)
`(progn (cl-callf bindat--align bindat-idx ,len) nil))
@ -747,7 +747,7 @@ is the name of a variable that will hold the value we need to pack.")
(let `#'(lambda (,val) (setq bindat-idx (+ bindat-idx ,len))) fun)
(guard (not (macroexp--fgrep `((,val)) len))))
;; Optimize the case where the size of each element is constant.
`(cl-incf bindat-idx (* ,count ,len)))
`(incf bindat-idx (* ,count ,len)))
;; FIXME: It's tempting to use `(mapc (lambda (,val) ,exp) ,val)'
;; which would be more efficient when `val' is a list,
;; but that's only right if length of `val' is indeed `count'.