]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Style fixes
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 7 Apr 2017 11:48:43 +0000 (12:48 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 7 Apr 2017 11:48:43 +0000 (12:48 +0100)
src/plugins/lua/antivirus.lua

index 6bcb9204877ef9053dc66e7679ab71d4a840dd3f..b801c18eefd590f004af51df56bb399dd7a9f2ca 100644 (file)
@@ -520,25 +520,20 @@ local function savapi_check(task, rule)
     local message_file = task:store_in_file(tonumber("0644", 8))
     local vnames = {}
 
-    -- Forward declaration for recursive calls
-    local savapi_scan1_cb
-
     local function savapi_fin_cb(err, conn)
       local vnames_reordered = {}
       -- Swap table
-      for virus,c in pairs(vnames) do
+      for virus,_ in pairs(vnames) do
         table.insert(vnames_reordered, virus)
       end
       rspamd_logger.debugm(N, task, "%s: number of virus names found %s", rule['type'], #vnames_reordered)
       if #vnames_reordered > 0 then
-        local vname = nil
+        local vname = {}
         for _,virus in ipairs(vnames_reordered) do
-          if vname then
-            vname = vname .. ';' .. virus
-          else
-            vname = virus
-          end
+          table.insert(vname, virus)
         end
+
+        vname = table.concat(vname, ';')
         yield_result(task, rule, vname)
         save_av_cache(task, rule, vname)
       end
@@ -582,7 +577,7 @@ local function savapi_check(task, rule)
       end
     end
 
-    function savapi_scan1_cb(err, conn)
+    local function savapi_scan1_cb(err, conn)
       conn:add_read(savapi_scan2_cb, '\n')
     end