Another sort function for hotkeys

This commit is contained in:
Henrique Santiago
2013-01-25 09:36:57 -02:00
parent 42b05df717
commit 839495fa9b
2 changed files with 19 additions and 36 deletions

View File

@@ -49,21 +49,3 @@ function string:explode(sep, limit)
table.insert(t, tmp)
return t
end
function string:operatorLess(other)
local selfLower = self:lower()
local otherLower = other:lower()
local selfLen = self:len()
local otherLen = other:len()
local minLen = math.min(selfLen, otherLen)
for i=1,minLen do
local selfByteI = string.byte(selfLower, i)
local otherByteI = string.byte(otherLower, i)
if selfByteI < otherByteI then
return true
elseif selfByteI > otherByteI then
return false
end
end
return selfLen < otherLen
end