[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: case-insensitive string<
From: |
Nikolaj Schumacher |
Subject: |
Re: case-insensitive string< |
Date: |
Fri, 17 Apr 2009 23:04:43 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (darwin) |
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.
regards,
Nikolaj Schumacher