diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-03-27 10:07:51 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-03-27 10:07:51 +0100 |
commit | e8aff44f70d7d477cade15d96caa378416462d20 (patch) | |
tree | aaf6431807f20ae29d1d1286a116bd2f4d427c01 /src | |
parent | ec3558f1d0a8b70f71477edb6cd7cf39884e2d1b (diff) | |
download | rspamd-e8aff44f70d7d477cade15d96caa378416462d20.tar.gz rspamd-e8aff44f70d7d477cade15d96caa378416462d20.zip |
[Minor] One more memoization fix
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/lua/phishing.lua | 13 |
1 files 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) |