Re: (no subject)
Re: (no subject)
- Subject: Re: (no subject)
- From: Scott Ribe <email@hidden>
- Date: Sun, 21 Dec 2008 10:20:36 -0700
- Thread-topic: (no subject)
> 1. Building a c++ array of integers with indices to the new sort order
> 2. Precalculate all crucial sort terms (that depend on external data)
> for the objects to be sorted.
> 3. Sort the index array manually (e.g., a shell sort from Numerical
> Recipes in C, pg 244 (my edition))
> 4. Once done, build a new array based on the sorted indices, and free
> any allocated memory
An intermediate step would be to add a sortOrder int attribute to the class,
then when the comparison selector is called, first calculate it if it's not
already set, then use it.
I've done something similar; the sortOrder attribute was actually a string,
but one whose calculation was somewhat expensive--caching the result
dramatically sped up the sort.
--
Scott Ribe
email@hidden
http://www.killerbytes.com/
(303) 722-0567 voice
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden