emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: uniq


From: René Kyllingstad
Subject: Re: uniq
Date: Sun, 5 Dec 2010 19:54:46 +0100

On Sat, Dec 4, 2010 at 3:09 PM, Stefan Monnier <address@hidden> 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é



reply via email to

[Prev in Thread] Current Thread [Next in Thread]