From: Nicolas Petton Date: Sun, 12 Jun 2016 10:37:16 +0000 (+0200) Subject: * lisp/emacs-lisp/seq.el (seq-drop): Better list implementation X-Git-Tag: emacs-26.0.90~1840^2~237 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=37f8a470d068c7dbb77fa515f09a9153b59aad35;p=emacs.git * lisp/emacs-lisp/seq.el (seq-drop): Better list implementation --- 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 @@ ;; Author: Nicolas Petton ;; 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."