Michael Jennings wrote:

This was originally what I wanted to do actually -- implement a
list-based quicksort (would require use of Ecore_Dlist). But it is
much more efficient as it is, doing an insertion sort while actually
inserting items into the list.


Both approaches are too restrictive.  What you need is to pass in a
comparison function for your insertion sort.  I used a similar
technique for the sorting/arranging code in EFM.  If you recall how
many "sort by" and "arrange by" options EFM had, you'll see the
flexibility inherent to that approach.


Actually yes, this is a better idea. The only snag here is that it would be inefficient. For sorting based on attributes other than filename, the comparison function would have to fetch metadata for each file it attempts to compare to another ... too many disk accesses per file would result in poor performance in large directories,u nless the directory list function prefetched file metadata into a struct that the comparison function could use.



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to