]> git.eshelyaron.com Git - emacs.git/commit
Use `take` where clearly safe to do so (bug#56521)
authorMattias Engdegård <mattiase@acm.org>
Sun, 17 Jul 2022 17:05:03 +0000 (19:05 +0200)
committerMattias Engdegård <mattiase@acm.org>
Mon, 18 Jul 2022 10:49:29 +0000 (12:49 +0200)
commit5ad8f3e5709a3823371ea6aa039b5e7e50feca1f
tree96673038a2d4499755be7c31bed4c82c9784b1d8
parent2d97fe271039358d24a779e5468a313ffcf6059a
Use `take` where clearly safe to do so (bug#56521)

* lisp/emacs-lisp/seq.el (seq-take):
* lisp/auth-source.el (auth-source-secrets-search)
(auth-source-plstore-search):
* lisp/gnus/message.el (message-insert-formatted-citation-line):
* lisp/net/dbus.el (dbus-unregister-object):
* lisp/replace.el (occur-context-lines):
* test/src/print-tests.el (print-circular): Replace hand-written loop
or `butlast` call with `take` for clarity, performance and validation.
We have the equivalence
(take N LIST) = (butlast LIST (- (length LIST) N)).
lisp/auth-source.el
lisp/emacs-lisp/seq.el
lisp/gnus/message.el
lisp/net/dbus.el
lisp/replace.el
test/src/print-tests.el