From 4daf38eaeb1c58e32048432f03af76daca80574a Mon Sep 17 00:00:00 2001 From: Anton Shestakov Date: Sat, 9 Jul 2016 10:27:57 +0800 Subject: util.ip: remove unused one-letter loop variables [luacheck] --- util/ip.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'util/ip.lua') diff --git a/util/ip.lua b/util/ip.lua index ec3b4d7e..1f32d1b5 100644 --- a/util/ip.lua +++ b/util/ip.lua @@ -51,11 +51,11 @@ local function toBits(ip) if not ip:match(":$") then fields[#fields] = nil; end for i, field in ipairs(fields) do if field:len() == 0 and i ~= 1 and i ~= #fields then - for i = 1, 16 * (9 - #fields) do + for _ = 1, 16 * (9 - #fields) do result = result .. "0"; end else - for i = 1, 4 - field:len() do + for _ = 1, 4 - field:len() do result = result .. "0000"; end for i = 1, field:len() do -- cgit v1.2.3 From 3e39dcb91599232fd141fa8919e9188f7314c9fc Mon Sep 17 00:00:00 2001 From: Anton Shestakov Date: Sat, 9 Jul 2016 17:33:38 +0800 Subject: util.ip: rename variable (i is already defined) [luacheck] --- util/ip.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'util/ip.lua') diff --git a/util/ip.lua b/util/ip.lua index 1f32d1b5..81a98ef7 100644 --- a/util/ip.lua +++ b/util/ip.lua @@ -58,8 +58,8 @@ local function toBits(ip) for _ = 1, 4 - field:len() do result = result .. "0000"; end - for i = 1, field:len() do - result = result .. hex2bits[field:sub(i,i)]; + for j = 1, field:len() do + result = result .. hex2bits[field:sub(j, j)]; end end end -- cgit v1.2.3