ZTree.com  | ZEN  | About...  

 Index   Back

[Wish] Alt-S(ort) Listing   [Wish]

By: Antti     Helsinki, FI  
Date: Feb 26,2013 at 18:26
In Response to: [Wish] Alt-S(ort) Listing (Juergen Hestermann)

> > Basically, what I was suggesting is an option to allow "Filespec and
> > Alt-Sort to operate on the result of a rename mask (instead of actual
> > filenames)". For example, sorting on a rename mask of "///*.*" would
> > in fact sort by names starting with the 4th character.
>
> If I understand this right I would expect a large performance hit. Each
> file name would have to be stored twice (original and renamed version)
> and then the mask has to be applied to the renamed version. Then these
> renamed versions have to be taken for sorting. This would not only be a
> huge decrease in speed but would also require additional memory and a
> significant coding effort.
>
> A simple offset would just move the character pointer before comparing.
> No need to duplicate the name string nor to modify it.
>

Assuming that the sorting is performed by something like the built-in C function qsort(void *array, size_t count, size_t size, comparison_fn_t compare), there would be no need to duplicate the name strings nor to modify them, even if rename masks would be supported for the sort key. As far as I can see, basically the only thing needed would be to implement a new comparison function that applies the rename mask before comparing the strings.

And, as the complex comparison function could be selected for use only when such a "sort mask" is provided, there would be no performance impact for the current sort options. When sorting on rename masks, the complex comparison function would, of course, involve a performance penalty (depending on the complexity of the rename mask processing).

956 views      
Thread locked
 

Messages in this Thread

 
96,637 Postings in 12,231 Threads, 350 registered users, 61 users online (0 registered, 61 guests)
Index | Admin contact |   Forum Time: Mar 28, 2024 - 8:58 am UTC  |  Hits:62,360,725  (13,122 Today )
RSS Feed