aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/neural.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-04-05 13:18:05 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-04-05 13:18:05 +0100
commit4b86e84051c9e3a9eb10e188ee8bc8840e796eca (patch)
tree4d16af480cefa900f2c917c75b81a30237db4409 /src/plugins/lua/neural.lua
parentf422d322ec1b36547f4c8f95f13cb631ca387ed4 (diff)
downloadrspamd-4b86e84051c9e3a9eb10e188ee8bc8840e796eca.tar.gz
rspamd-4b86e84051c9e3a9eb10e188ee8bc8840e796eca.zip
[Minor] Use override_defaults from lua_util
Diffstat (limited to 'src/plugins/lua/neural.lua')
-rw-r--r--src/plugins/lua/neural.lua17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/plugins/lua/neural.lua b/src/plugins/lua/neural.lua
index 547751f93..89f003b2a 100644
--- a/src/plugins/lua/neural.lua
+++ b/src/plugins/lua/neural.lua
@@ -975,24 +975,9 @@ else
end
return copy
end
- local function override_defaults(def, override)
- for k,v in pairs(override) do
- if def[k] then
- if type(v) == 'table' then
- override_defaults(def[k], v)
- else
- def[k] = v
- end
- else
- def[k] = v
- end
- end
- end
for k,r in pairs(rules) do
- local def_rules = deepcopy(default_options)
+ local def_rules = lua_util.override_defaults(default_options, r)
def_rules['redis'] = redis_params
- -- Override defaults
- override_defaults(def_rules, r)
if not def_rules.prefix then
def_rules.prefix = k