From 93b5c7300bcb934d78512c4d21831ffa592cd5ee Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Sat, 21 May 2016 13:46:44 +0100 Subject: [PATCH] simplez simplify and make os.time() default --- functions.lua | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/functions.lua b/functions.lua index ccb7cb7..f74a7e8 100644 --- a/functions.lua +++ b/functions.lua @@ -82,11 +82,8 @@ function ipnames.save_data() ipnames.changes = false local file = io.open(ipnames.file, "w") for k, v in pairs(ipnames.data) do - if v[2] and v[2] > 0 then - file:write(k.."|"..v[1].."|"..v[2].."\n") - else - file:write(k.."|"..v[1].."\n") - end + v[2] = v[2] or os.time() + file:write(k.."|"..v[1].."|"..v[2].."\n") end io.close(file) end