Perl Monk, Perl Meditation | |
PerlMonks |
Re: a more efficient lexicographical sort?by Limbic~Region (Chancellor) |
on Jan 18, 2006 at 19:08 UTC ( [id://524040]=note: print w/replies, xml ) | Need Help?? |
Anonymous Monk,
The oid_lex_sort() function uses the Schwartzian Transform. Additionally, it uses regular expressions to eliminate leading periods and converts spaces to '.0' globally. If you know none of your OIDs require those regexes then the following might be better. Benchmarking will say for sure. It is a straight forward translation to tye's one true sort. Update: Other improvements likely exist but I don't know what constitutes a lexicographical sort of OIDs. Cheers - L~R
In Section
Seekers of Perl Wisdom
|
|