aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/lua_selectors/extractors.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-04-30 12:44:42 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-04-30 12:44:42 +0100
commit1f68d27762293d8de8953981b75af90729b7bc30 (patch)
tree80601d22a71e1efd5e93c62c6b422dec9c9c9c1b /lualib/lua_selectors/extractors.lua
parentf2a5e351ef0401b37010c844dff3e4374928aaa0 (diff)
downloadrspamd-1f68d27762293d8de8953981b75af90729b7bc30.tar.gz
rspamd-1f68d27762293d8de8953981b75af90729b7bc30.zip
[Minor] Selectors: Optimize the case
Diffstat (limited to 'lualib/lua_selectors/extractors.lua')
-rw-r--r--lualib/lua_selectors/extractors.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/lualib/lua_selectors/extractors.lua b/lualib/lua_selectors/extractors.lua
index e0d692135..e800e98e9 100644
--- a/lualib/lua_selectors/extractors.lua
+++ b/lualib/lua_selectors/extractors.lua
@@ -136,7 +136,13 @@ uses any type by default)]],
local digests = {}
for _,p in ipairs(parts) do
if p:get_filename() then
- table.insert(digests, common.create_digest(p:get_content('raw_parsed'), args))
+ if not args[2] or args[2] == 'blake2' then
+ -- Optimise as we already have this hash
+ table.insert(digests, p:get_digest())
+ else
+ table.insert(digests, common.create_digest(p:get_content('raw_parsed'), args))
+ end
+
end
end