[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: case-insensitive string<
From: |
thierry . volpiatto |
Subject: |
Re: case-insensitive string< |
Date: |
Fri, 17 Apr 2009 23:17:48 +0200 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.92 (gnu/linux) |
Nikolaj Schumacher <me@nschum.de> writes:
> thierry.volpiatto@gmail.com wrote:
>
>> (sort* (list "abc" "abd" "abCde" "cade" "ABC") 'string< :key 'downcase)
>> ("abc" "ABC" "abCde" "abd" "cade")
>>
>> But not sure it is faster than downcasing all strings before sorting.
>> Need testing.
>
> It's significantly slower.
>
> It's the same as using:
> (lambda (a b) (string< (downcase a) (downcase b)))
>
> so that's O(n*log(n)) calls to downcase, instead of n.
>
Ok, that's good to know.
Thank you.
--
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France