From e8aff44f70d7d477cade15d96caa378416462d20 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 27 Mar 2017 10:07:51 +0100 Subject: [PATCH] [Minor] One more memoization fix --- src/plugins/lua/phishing.lua | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/plugins/lua/phishing.lua b/src/plugins/lua/phishing.lua index d248c7513..74909e9da 100644 --- a/src/plugins/lua/phishing.lua +++ b/src/plugins/lua/phishing.lua @@ -239,17 +239,12 @@ local function phishing_map(mapname, phishmap, id) end end -local lpeg_grammar local function rspamd_str_split_fun(s, sep, func) local lpeg = require "lpeg" - - if not lpeg_grammar then - sep = lpeg.P(sep) - local elem = lpeg.C((1 - sep)^0 / func) - local p = lpeg.C(elem * (sep * elem)^0) -- make a table capture - lpeg_grammar = p - end - return lpeg.match(lpeg_grammar, s) + sep = lpeg.P(sep) + local elem = lpeg.C((1 - sep)^0 / func) + local p = lpeg.C(elem * (sep * elem)^0) -- make a table capture + return p:match(s) end local function insert_url_from_string(pool, tbl, str, data) -- 2.39.5