forked from minetest-mods/MoreMesecons
Refactor expand in Lua 5.1
This commit is contained in:
parent
0950963cd3
commit
a08ab4f93d
13
md5.lua
13
md5.lua
|
@ -68,15 +68,10 @@ else
|
||||||
return rslt
|
return rslt
|
||||||
end
|
end
|
||||||
|
|
||||||
local function expand(tbl_m, tbl_n)
|
local function expand(t1, t2)
|
||||||
local big = {}
|
local big, small = t1, t2
|
||||||
local small = {}
|
if(#big < #small) then
|
||||||
if(#tbl_m > #tbl_n) then
|
big, small = small, big
|
||||||
big = tbl_m
|
|
||||||
small = tbl_n
|
|
||||||
else
|
|
||||||
big = tbl_n
|
|
||||||
small = tbl_m
|
|
||||||
end
|
end
|
||||||
-- expand small
|
-- expand small
|
||||||
for i = #small + 1, #big do
|
for i = #small + 1, #big do
|
||||||
|
|
Loading…
Reference in New Issue
Block a user