refactoring
This commit is contained in:
+5
-5
@@ -1,10 +1,10 @@
|
||||
module 'sorting'
|
||||
|
||||
public.LT = {}
|
||||
public.EQ = {}
|
||||
public.GT = {}
|
||||
public()
|
||||
|
||||
function public.compare(a, b, desc)
|
||||
LT, EQ, GT = t, t, t
|
||||
|
||||
function compare(a, b, desc)
|
||||
if a < b then
|
||||
return desc and GT or LT
|
||||
elseif a > b then
|
||||
@@ -14,7 +14,7 @@ function public.compare(a, b, desc)
|
||||
end
|
||||
end
|
||||
|
||||
function public.multi_lt(xs, ys)
|
||||
function multi_lt(xs, ys)
|
||||
local i = 1
|
||||
while true do
|
||||
if xs[i] and ys[i] and xs[i] ~= ys[i] then
|
||||
|
||||
Reference in New Issue
Block a user