From: Vsevolod Stakhov Date: Tue, 28 Jul 2020 19:24:14 +0000 (+0100) Subject: [Minor] Pet luacheck X-Git-Tag: 2.6~199 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=922050a86faf173e8e82b3ab26200415dc30ed22;p=thirdparty%2Frspamd.git [Minor] Pet luacheck --- diff --git a/rules/bitcoin.lua b/rules/bitcoin.lua index 0c9c79bac9..cb6603e8c5 100644 --- a/rules/bitcoin.lua +++ b/rules/bitcoin.lua @@ -121,16 +121,6 @@ local function gen_bleach32_table(input) return res and d or nil end -local function slice_table(tbl, first, last, step) - local sliced = {} - - for i = first or 1, last or #tbl, step or 1 do - sliced[#sliced+1] = tbl[i] - end - - return sliced -end - local function is_segwit_bech32_address(task, word) local semicolon_pos = string.find(word, ':') local address_part = word @@ -161,8 +151,7 @@ local function is_segwit_bech32_address(task, word) lua_util.debugm(N, task, 'check %s, %s decoded', word, decoded) if decoded and #decoded > 8 then - local c = 1 - local prefix = word:sub(1, semicolon_pos - 1) + prefix = word:sub(1, semicolon_pos - 1) local polymod_tbl = {} fun.each(function(byte) local b = bit.band(string.byte(byte), 0x1f) @@ -172,7 +161,7 @@ local function is_segwit_bech32_address(task, word) -- For semicolon table.insert(polymod_tbl, 0) - fun.each(function(byte) c = table.insert(polymod_tbl, byte) end, decoded) + fun.each(function(byte) table.insert(polymod_tbl, byte) end, decoded) lua_util.debugm(N, task, 'final polymod table: %s', polymod_tbl) return rspamd_util.btc_polymod(polymod_tbl)