mirror of
https://github.com/edubart/otclient.git
synced 2025-10-15 12:04:55 +02:00
Another sort function for hotkeys
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user