From: "René Kyllingstad" <listmailemacs@kyllingstad.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Stephen Berman <stephen.berman@gmx.net>, emacs-devel@gnu.org
Subject: Re: uniq
Date: Sun, 5 Dec 2010 19:54:46 +0100 [thread overview]
Message-ID: <AANLkTini=5wivATDL4VRu5ZcFP1qbriMFD9Vik6k2u-Q@mail.gmail.com> (raw)
In-Reply-To: <jwvd3phk4x1.fsf-monnier+emacs@gnu.org>
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.
-- René
next prev parent reply other threads:[~2010-12-05 18:54 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 ` René Kyllingstad [this message]
2010-12-05 19:15 ` uniq Lennart Borgman
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='AANLkTini=5wivATDL4VRu5ZcFP1qbriMFD9Vik6k2u-Q@mail.gmail.com' \
--to=listmailemacs@kyllingstad.com \
--cc=emacs-devel@gnu.org \
--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.