From: Ari Roponen <ari.roponen@gmail.com>
To: 21058@debbugs.gnu.org
Subject: bug#21058: 25.0.50; delete-dups doesn't delete all duplicates
Date: Wed, 15 Jul 2015 08:40:06 +0300 [thread overview]
Message-ID: <87bnfef07d.fsf@gmail.com> (raw)
Tags: patch
Function delete-dups doesn't delete all duplicates from long
lists:
(delete-dups (mapcar (lambda (x) (% x 3)) (number-sequence 0 102)))
=> (0 1 2 1 0 2 1 0 2 1 0 2 ...)
The following patch seems to fix the problem.
* lisp/subr.el (delete-dups): Fix paren typo.
diff --git a/lisp/subr.el b/lisp/subr.el
index 5bd4bb4..e2c1bae 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -426,8 +426,8 @@ one is kept."
(let ((elt (car retail)))
(if (gethash elt hash)
(setcdr tail (cdr retail))
- (puthash elt t hash)))
- (setq tail retail)))
+ (puthash elt t hash)
+ (setq tail retail)))))
(let ((tail list))
(while tail
(setcdr tail (delete (car tail) (cdr tail)))
In GNU Emacs 25.0.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 3.17.4)
of 2015-07-14 on arirop
Repository revision: 6a7e718916d00dbacaa765669f389b86f33075f5
Windowing system distributor `Fedora Project', version 11.0.11702000
System Description: Fedora release 23 (Rawhide)
--
Ari Roponen
next reply other threads:[~2015-07-15 5:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-15 5:40 Ari Roponen [this message]
2015-07-15 6:14 ` bug#21058: 25.0.50; delete-dups doesn't delete all duplicates Vaidheeswaran C
2015-07-16 14:55 ` Paul Eggert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bnfef07d.fsf@gmail.com \
--to=ari.roponen@gmail.com \
--cc=21058@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.