From: Artur Malabarba Date: Wed, 6 May 2015 18:27:43 +0000 (+0100) Subject: * lisp/subr.el (delete-dups): Make it destructive again. X-Git-Tag: emacs-25.0.90~2176 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f201bf6a5050d575dfc759fa23955fab0fbcfcb9;p=emacs.git * lisp/subr.el (delete-dups): Make it destructive again. --- diff --git a/lisp/subr.el b/lisp/subr.el index 591980d03fa..a32fb968365 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -424,12 +424,12 @@ one is kept." (unless (gethash elt hash) (puthash elt elt hash) (push elt res))) - (nreverse res)) + (setcdr list (cdr (nreverse res)))) (let ((tail list)) (while tail (setcdr tail (delete (car tail) (cdr tail))) - (setq tail (cdr tail)))) - list)) + (setq tail (cdr tail))))) + list) ;; See http://lists.gnu.org/archive/html/emacs-devel/2013-05/msg00204.html (defun delete-consecutive-dups (list &optional circular)