From: Vsevolod Stakhov Date: Thu, 30 Apr 2020 11:44:42 +0000 (+0100) Subject: [Minor] Selectors: Optimize the case X-Git-Tag: 2.6~471 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1f68d27762293d8de8953981b75af90729b7bc30;p=rspamd.git [Minor] Selectors: Optimize the case --- 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