W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2009

[whatwg] DOMTokenList is unordered but yet requires sorting

From: Darin Adler <darin@apple.com>
Date: Mon, 15 Jun 2009 12:38:05 -0700
Message-ID: <36F6306B-60AF-4098-997A-B89EEAF1B278@apple.com>
On Jun 15, 2009, at 12:22 PM, Ian Hickson wrote:

> On Tue, 9 Jun 2009, Erik Arvidsson wrote:
>>
>
>> I was about to follow up on this. Requiring sorting which is O(n  
>> log n) for something that can be done in O(n) makes thing slower  
>> without any real benefit. Like Jo?o said the order should be  
>> defined as the order of the class content attribute.
>
> Fair enough. Done.

Since DOMTokenList requires uniqueness, then I suspect it's still O(n  
log n) even without sorting, not O(n).

     -- Darin
Received on Monday, 15 June 2009 12:38:05 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:13 UTC