aboutsummaryrefslogtreecommitdiffstats
path: root/lualib
diff options
context:
space:
mode:
authorThomas Oettli <spacefreak@noop.ch>2024-09-13 11:40:13 +0200
committerThomas Oettli <spacefreak@noop.ch>2024-09-13 11:40:13 +0200
commit3f1cbad721afaa58a8eb140227d0c60f6df2162f (patch)
tree07acdfd4d870149316f7565dfcc55cb22997a9f0 /lualib
parentcf4ee94734b0d0cfd0f307210096d61ab062331e (diff)
downloadrspamd-3f1cbad721afaa58a8eb140227d0c60f6df2162f.tar.gz
rspamd-3f1cbad721afaa58a8eb140227d0c60f6df2162f.zip
[Minor] remove unnecessary calls of lpeg.P in DMARC grammar
Just to make to code more readable.
Diffstat (limited to 'lualib')
-rw-r--r--lualib/plugins/dmarc.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/lualib/plugins/dmarc.lua b/lualib/plugins/dmarc.lua
index b05a3a0ef..720c76e16 100644
--- a/lualib/plugins/dmarc.lua
+++ b/lualib/plugins/dmarc.lua
@@ -241,10 +241,10 @@ local function gen_dmarc_grammar()
local space = lpeg.space ^ 0
local name = lpeg.C(lpeg.alpha ^ 1)
local sep = space * lpeg.S("\\;") * space
- local value = lpeg.C(lpeg.P(lpeg.P((lpeg.space ^ 1) * lpeg.graph + lpeg.P(lpeg.graph)) - sep) ^ 1)
+ local value = lpeg.C(((lpeg.space ^ 1 * lpeg.graph + lpeg.graph) - sep) ^ 1)
local pair = lpeg.Cg(name * "=" * space * value) * sep ^ -1
local list = lpeg.Cf(lpeg.Ct("") * pair ^ 0, rawset)
- local version = lpeg.P("v") * space * lpeg.P("=") * space * lpeg.P("DMARC1")
+ local version = "v" * space * "=" * space * "DMARC1"
local record = version * sep * list
return record