diff options
author | Nicolas Petton <nicolas@petton.fr> | 2016-06-12 12:37:16 +0200 |
---|---|---|
committer | Nicolas Petton <nicolas@petton.fr> | 2016-06-12 12:41:42 +0200 |
commit | 37f8a470d068c7dbb77fa515f09a9153b59aad35 (patch) | |
tree | e0eab86b0cb886a5c59b7182a90a9deccecb2316 | |
parent | 643e0b8d2857ed63cb9e94731a30d8ed0e9ca889 (diff) |
* 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 92f0ad7856..166e886fd8 100644 --- a/lisp/emacs-lisp/seq.el +++ b/lisp/emacs-lisp/seq.el @@ -4,7 +4,7 @@ ;; Author: Nicolas Petton <nicolas@petton.fr> ;; Keywords: sequences -;; Version: 2.14 +;; Version: 2.16 ;; Package: seq ;; Maintainer: emacs-devel@gnu.org @@ -471,10 +471,7 @@ If no element is found, return nil." (cl-defmethod seq-drop ((list list) n) "Optimized implementation of `seq-drop' for lists." - (while (and list (> n 0)) - (setq list (cdr list) - n (1- n))) - list) + (nthcdr n list)) (cl-defmethod seq-take ((list list) n) "Optimized implementation of `seq-take' for lists." |