1. Re: Sort Insensitive

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

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu