Various code fixes detected by luacheck

* Luablock: Fix the missing position argument when executing the lua code fails
* Wireless: Fix the missing id argument
* Localize several variables
* Some other small changes, e.g. dead code removal
This commit is contained in:
HybridDog
2021-03-08 19:34:21 +01:00
committed by Pierre-Adrien Langrognet
parent 28292dc2a5
commit c41d0371c0
10 changed files with 39 additions and 41 deletions

View File

@ -243,12 +243,11 @@ MapDataStorage.__index = {
indices[i] = ("%.17g"):format(vi)
values[i] = v
end
result = {
return minetest.serialize({
version = "MapDataStorage_v1",
indices = "return {" .. table.concat(indices, ",") .. "}",
values = minetest.serialize(values),
}
return minetest.serialize(result)
})
end,
}
MapDataStorage.deserialize = function(txtdata)
@ -317,6 +316,7 @@ end
--[[
-- This testing code shows an example usage of the MapDataStorage code
local function do_test()
print("Test if iter returns correct positions when a lot is set")
@ -377,5 +377,5 @@ local function do_test()
--~ data:iterAll()
end
--~ do_test()
do_test()
--]]