From 1f68d27762293d8de8953981b75af90729b7bc30 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 30 Apr 2020 12:44:42 +0100 Subject: [PATCH] [Minor] Selectors: Optimize the case --- lualib/lua_selectors/extractors.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- 2.39.5