From f096fb4dbbfae72d4669f6ea3a25823c16e2934d Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Mon, 18 Nov 2013 21:01:24 -0500 Subject: Use table indices as IDs This significantly optimizes a lot of operations and removes redundancy. --- init.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index d3ffd74..1aca354 100644 --- a/init.lua +++ b/init.lua @@ -21,12 +21,17 @@ areas:load() minetest.register_privilege("areas", {description = "Can administer areas"}) if not minetest.registered_privileges[areas.self_protection_privilege] then - minetest.register_privilege(areas.self_protection_privilege, - {description = "Can protect areas"}) + minetest.register_privilege(areas.self_protection_privilege, { + description = "Can protect areas", + }) +end + +for _, area in pairs(areas.areas) do + area.id = nil end if minetest.setting_getbool("log_mod") then local diffTime = os.clock() - areas.startTime - print("[areas] loaded in "..diffTime.."s.") + minetest.log("action", "areas loaded in "..diffTime.."s.") end -- cgit v1.2.3