commit 922050a: [Minor] Pet luacheck

Vsevolod Stakhov vsevolod at highsecure.ru
Tue Jul 28 19:56:07 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-07-28 20:24:14 +0100
URL: https://github.com/rspamd/rspamd/commit/922050a86faf173e8e82b3ab26200415dc30ed22

[Minor] Pet luacheck

---
 rules/bitcoin.lua | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/rules/bitcoin.lua b/rules/bitcoin.lua
index 0c9c79bac..cb6603e8c 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)


More information about the Commits mailing list