1. Re: Sort Insensitive
- Posted by Terry Constant <constant at FLASH.NET> Jun 21, 1998
- 566 views
After fiddling with the case insensitive sort some more, I have come up with the following as the best alternative to get the fastest sort speeds for what I will be doing. If anyone has a suggestion for a way to write faster sort routines, I am certainly interested to know. --Rsort.e include sort.e integer iInsensitive, iStrInsensitive function CompareInsensitive(object a, object b) return compare(upper(a),upper(b)) end function --CompareStrInsensitive iInsensitive = routine_id("CompareInsensitive") function CompareStrInsensitive(integer a, integer b) return compare(upper(a),upper(b)) end function --CompareStrInsensitive iStrInsensitive = routine_id("CompareStrInsensitive") global function sorti(sequence s) --/ Do a case insensitive sort --/ Sorts sequences or strings return custom_sort(iInsensitive, s) end function --sorti global function SortStri(sequence st) --/ Sorts strings. Optimized for speed with strings return custom_sort(iStrInsensitive, st) end function --SortStri --end file -- Terry Constant mailto:constant at flash.net