From 37f8a470d068c7dbb77fa515f09a9153b59aad35 Mon Sep 17 00:00:00 2001 From: Nicolas Petton Date: Sun, 12 Jun 2016 12:37:16 +0200 Subject: [PATCH] * lisp/emacs-lisp/seq.el (seq-drop): Better list implementation --- lisp/emacs-lisp/seq.el | 7 ++----- 1 file 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 @@ ;; 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." -- 2.39.2