From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: What to do for faster `remove-duplicates'? Date: Wed, 06 May 2015 16:54:08 -0400 Message-ID: References: <87383atb2p.fsf@gmail.com> <873839ltoa.fsf@gmail.com> <87bnhxeh4j.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1430945677 27799 80.91.229.3 (6 May 2015 20:54:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 May 2015 20:54:37 +0000 (UTC) Cc: emacs-devel , Thierry Volpiatto To: Artur Malabarba Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 06 22:54:29 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Yq6Ko-0006nX-1v for ged-emacs-devel@m.gmane.org; Wed, 06 May 2015 22:54:26 +0200 Original-Received: from localhost ([::1]:47047 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yq6Kn-0003cx-9p for ged-emacs-devel@m.gmane.org; Wed, 06 May 2015 16:54:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37360) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yq6Kb-0003cs-5f for emacs-devel@gnu.org; Wed, 06 May 2015 16:54:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yq6KX-0005gw-U0 for emacs-devel@gnu.org; Wed, 06 May 2015 16:54:13 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:39612) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yq6KX-0005fy-PZ for emacs-devel@gnu.org; Wed, 06 May 2015 16:54:09 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnEFAGvvdVRFpYts/2dsb2JhbAA3gVOfQYIugQiBdQEBBAFWIwULCw4mEhQYDSSIE6IRi3Y0OgkDAQKDPgODcASjY4RY X-IPAS-Result: AnEFAGvvdVRFpYts/2dsb2JhbAA3gVOfQYIugQiBdQEBBAFWIwULCw4mEhQYDSSIE6IRi3Y0OgkDAQKDPgODcASjY4RY X-IronPort-AV: E=Sophos;i="5.11,557,1422939600"; d="scan'208";a="118474771" Original-Received: from 69-165-139-108.dsl.teksavvy.com (HELO pastel.home) ([69.165.139.108]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 06 May 2015 16:54:08 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 443502214; Wed, 6 May 2015 16:54:08 -0400 (EDT) In-Reply-To: (Artur Malabarba's message of "Wed, 6 May 2015 19:31:47 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:186301 Archived-At: >>> Looks good, please install. >> Not so good as now it is no more destructive for a seq > 100. Not being destructive doesn't seem like a serious problem to me. `delete-*' functions are allowed to work destructively (as an optimization) but if they don't, I wouldn't hold it against them, as long as they're still fast. > modified 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)))) I don't understand what this is intended to do. Stefan