j
: Next unread message k
: Previous unread message j a
: Jump to all threads
j l
: Jump to MailingList overview
At Wednesday, 1 May 2002, you wrote:
No, I don't think it is known and accepted.
And #addAll: is implemented in SortedCollection
addAll: aCollection aCollection size > (self size // 3) ifTrue: [aCollection do: [:each | self addLast: each]. self reSort] ifFalse: [aCollection do: [:each | self add: each]]. ^ aCollection
When you send asSortedCollection to an unsorted collection, the ifTrue part is what is used -- it adds all the elements, and then does an in-place sort. I haven't checked Squeak, but I assume it uses some variation of Quicksort. This (a large collection equal values) is probably just a worst-case scenario for whatever sorting algorithm is used.
Later, Jon
-------------------------------------------------------------- Jon Hylands Jon@huv.com http://www.huv.com/jon
Project: Micro Seeker (Micro Autonomous Underwater Vehicle) http://www.huv.com
squeak-dev@lists.squeakfoundation.org