all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lennart Borgman <lennart.borgman@gmail.com>
To: "René Kyllingstad" <listmailemacs@kyllingstad.com>
Cc: Stephen Berman <stephen.berman@gmx.net>,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	emacs-devel@gnu.org
Subject: Re: uniq
Date: Sun, 5 Dec 2010 20:15:33 +0100	[thread overview]
Message-ID: <AANLkTi=E_kz-K7cQJucGJREbiiNWxdcsMZu4aTCpHGqY@mail.gmail.com> (raw)
In-Reply-To: <AANLkTini=5wivATDL4VRu5ZcFP1qbriMFD9Vik6k2u-Q@mail.gmail.com>

2010/12/5 René Kyllingstad <listmailemacs@kyllingstad.com>:
> On Sat, Dec 4, 2010 at 3:09 PM, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>>> 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.

Or maybe using a schwarzian transform to sort only line numbers and
then from this list just delete duplicates (moving backwards).



      reply	other threads:[~2010-12-05 19:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-04  2:41 uniq Tak Ota
2010-12-04 12:08 ` uniq Stephen Berman
2010-12-04 14:09   ` uniq Stefan Monnier
2010-12-05 18:54     ` uniq René Kyllingstad
2010-12-05 19:15       ` Lennart Borgman [this message]

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='AANLkTi=E_kz-K7cQJucGJREbiiNWxdcsMZu4aTCpHGqY@mail.gmail.com' \
    --to=lennart.borgman@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=listmailemacs@kyllingstad.com \
    --cc=monnier@iro.umontreal.ca \
    --cc=stephen.berman@gmx.net \
    /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.