mirror of
https://github.com/minetest-mods/MoreMesecons.git
synced 2024-08-20 05:04:09 +02:00
Remove unnecessary calculations
The “expand” before the loops ensures that both tables (tbl_m and tbl_n) have the same length
This commit is contained in:
parent
907bbd1655
commit
77ac109e66
9
md5.lua
9
md5.lua
@ -116,8 +116,7 @@ else
|
||||
expand(tbl_m, tbl_n)
|
||||
|
||||
local tbl = {}
|
||||
local rslt = max(#tbl_m, #tbl_n)
|
||||
for i = 1, rslt do
|
||||
for i = 1, #tbl_m do
|
||||
if(tbl_m[i]== 0 and tbl_n[i] == 0) then
|
||||
tbl[i] = 0
|
||||
else
|
||||
@ -134,8 +133,7 @@ else
|
||||
expand(tbl_m, tbl_n)
|
||||
|
||||
local tbl = {}
|
||||
local rslt = max(#tbl_m, #tbl_n)
|
||||
for i = 1, rslt do
|
||||
for i = 1, #tbl_m do
|
||||
if(tbl_m[i]== 0 or tbl_n[i] == 0) then
|
||||
tbl[i] = 0
|
||||
else
|
||||
@ -152,8 +150,7 @@ else
|
||||
expand(tbl_m, tbl_n)
|
||||
|
||||
local tbl = {}
|
||||
local rslt = max(#tbl_m, #tbl_n)
|
||||
for i = 1, rslt do
|
||||
for i = 1, #tbl_m do
|
||||
if(tbl_m[i] ~= tbl_n[i]) then
|
||||
tbl[i] = 1
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user