Refactor expand in Lua 5.1

This commit is contained in:
kikito 2015-04-06 17:23:12 +02:00
parent 0950963cd3
commit a08ab4f93d

13
md5.lua
View File

@ -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