diff options
| author | Nicolas Petton | 2016-06-12 12:37:16 +0200 |
|---|---|---|
| committer | Nicolas Petton | 2016-06-12 12:41:42 +0200 |
| commit | 37f8a470d068c7dbb77fa515f09a9153b59aad35 (patch) | |
| tree | e0eab86b0cb886a5c59b7182a90a9deccecb2316 | |
| parent | 643e0b8d2857ed63cb9e94731a30d8ed0e9ca889 (diff) | |
| download | emacs-37f8a470d068c7dbb77fa515f09a9153b59aad35.tar.gz emacs-37f8a470d068c7dbb77fa515f09a9153b59aad35.zip | |
* lisp/emacs-lisp/seq.el (seq-drop): Better list implementation
| -rw-r--r-- | lisp/emacs-lisp/seq.el | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el index 92f0ad78566..166e886fd80 100644 --- a/lisp/emacs-lisp/seq.el +++ b/lisp/emacs-lisp/seq.el | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | ;; Author: Nicolas Petton <nicolas@petton.fr> | 5 | ;; Author: Nicolas Petton <nicolas@petton.fr> |
| 6 | ;; Keywords: sequences | 6 | ;; Keywords: sequences |
| 7 | ;; Version: 2.14 | 7 | ;; Version: 2.16 |
| 8 | ;; Package: seq | 8 | ;; Package: seq |
| 9 | 9 | ||
| 10 | ;; Maintainer: emacs-devel@gnu.org | 10 | ;; Maintainer: emacs-devel@gnu.org |
| @@ -471,10 +471,7 @@ If no element is found, return nil." | |||
| 471 | 471 | ||
| 472 | (cl-defmethod seq-drop ((list list) n) | 472 | (cl-defmethod seq-drop ((list list) n) |
| 473 | "Optimized implementation of `seq-drop' for lists." | 473 | "Optimized implementation of `seq-drop' for lists." |
| 474 | (while (and list (> n 0)) | 474 | (nthcdr n list)) |
| 475 | (setq list (cdr list) | ||
| 476 | n (1- n))) | ||
| 477 | list) | ||
| 478 | 475 | ||
| 479 | (cl-defmethod seq-take ((list list) n) | 476 | (cl-defmethod seq-take ((list list) n) |
| 480 | "Optimized implementation of `seq-take' for lists." | 477 | "Optimized implementation of `seq-take' for lists." |