From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Ren=E9_Kyllingstad?= Newsgroups: gmane.emacs.devel Subject: Re: uniq Date: Sun, 5 Dec 2010 19:54:46 +0100 Message-ID: References: <20101203.184112.37434497.Takaaki.Ota@am.sony.com> <87ipz9hhab.fsf@escher.home> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1291575320 7318 80.91.229.12 (5 Dec 2010 18:55:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 5 Dec 2010 18:55:20 +0000 (UTC) Cc: Stephen Berman , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 05 19:55:16 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PPJjv-0003xn-LU for ged-emacs-devel@m.gmane.org; Sun, 05 Dec 2010 19:55:15 +0100 Original-Received: from localhost ([127.0.0.1]:32865 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PPJjv-0001Hd-57 for ged-emacs-devel@m.gmane.org; Sun, 05 Dec 2010 13:55:15 -0500 Original-Received: from [140.186.70.92] (port=57905 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PPJjp-0001HR-JT for emacs-devel@gnu.org; Sun, 05 Dec 2010 13:55:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PPJjo-0002Ig-3K for emacs-devel@gnu.org; Sun, 05 Dec 2010 13:55:09 -0500 Original-Received: from mail-vw0-f41.google.com ([209.85.212.41]:38955) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PPJjn-0002IO-Vr for emacs-devel@gnu.org; Sun, 05 Dec 2010 13:55:08 -0500 Original-Received: by vws10 with SMTP id 10so4867281vws.0 for ; Sun, 05 Dec 2010 10:55:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received :in-reply-to:references:from:date:x-google-sender-auth:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=hOFTmdr9PEMG7DfSjEGfI2z7MNmC+MaZVdb/Rl0e2uU=; b=JnQkMpZj/Tr+arPfVMzNbDzPKSdy4234OOzbVAnjJH0cvSj45ze/qVlJLL/ZlzQZD7 0e28OS76dgkyxgfjoQlDG40TRHOUvgS1AhyYhQTOB2YCmW0g7MRI6sZ7OBN6K2NZUN61 lXl49ZW93Rg7TjW0x7duBmRCk7mo8TDyIPO2I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=BtAzO17tGEdl0OlZgDVXjhLcM/4KPkFCmZJgB1HmZRfIvn7LEfudMxbZFyowqXHM7J b5fvGU/qLY7nkqjpxaBwLXJWAEjF3W0JfxP/iY0xqBHLcR5D1/cMfmirX8FxnEX76Wff hB9XiPHrQ0YB5jKxdPssY24fH+wdvhYX4JSdE= Original-Received: by 10.220.190.5 with SMTP id dg5mr1208139vcb.163.1291575306490; Sun, 05 Dec 2010 10:55:06 -0800 (PST) Original-Received: by 10.220.74.4 with HTTP; Sun, 5 Dec 2010 10:54:46 -0800 (PST) In-Reply-To: X-Google-Sender-Auth: swW9UjnPpEnYS13awN5dDglCHHc X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:133435 Archived-At: On Sat, Dec 4, 2010 at 3:09 PM, Stefan Monnier w= rote: >> Would it be faster to avoid nested while-loops? > > Not sure if `member' is faster than `re-search-forward', but if you > replace re-search-forward with just search-forward (which requires > a bit more care since you need to manually check that matches are > anchored at bol and eol) I'm pretty sure that'll be even faster since it > will then use a more efficient search algorithm that gets faster the > longer the line of text you're looking for. Even better, use a hash table to keep the already seen lines. Maybe call it delete-duplicate-lines, similar to delete-matching-lines. -- Ren=E9