From f201bf6a5050d575dfc759fa23955fab0fbcfcb9 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Wed, 6 May 2015 19:27:43 +0100 Subject: [PATCH] * lisp/subr.el (delete-dups): Make it destructive again. --- lisp/subr.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) -- 2.39.2