mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-10 08:10:21 -08:00
* lisp/emacs-lisp/seq.el (seq-drop): Better list implementation
This commit is contained in:
parent
643e0b8d28
commit
37f8a470d0
1 changed files with 2 additions and 5 deletions
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
;; Author: Nicolas Petton <nicolas@petton.fr>
|
;; Author: Nicolas Petton <nicolas@petton.fr>
|
||||||
;; Keywords: sequences
|
;; Keywords: sequences
|
||||||
;; Version: 2.14
|
;; Version: 2.16
|
||||||
;; Package: seq
|
;; Package: seq
|
||||||
|
|
||||||
;; Maintainer: emacs-devel@gnu.org
|
;; Maintainer: emacs-devel@gnu.org
|
||||||
|
|
@ -471,10 +471,7 @@ If no element is found, return nil."
|
||||||
|
|
||||||
(cl-defmethod seq-drop ((list list) n)
|
(cl-defmethod seq-drop ((list list) n)
|
||||||
"Optimized implementation of `seq-drop' for lists."
|
"Optimized implementation of `seq-drop' for lists."
|
||||||
(while (and list (> n 0))
|
(nthcdr n list))
|
||||||
(setq list (cdr list)
|
|
||||||
n (1- n)))
|
|
||||||
list)
|
|
||||||
|
|
||||||
(cl-defmethod seq-take ((list list) n)
|
(cl-defmethod seq-take ((list list) n)
|
||||||
"Optimized implementation of `seq-take' for lists."
|
"Optimized implementation of `seq-take' for lists."
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue