diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-12-11 18:17:16 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-12-11 18:17:16 +0000 |
commit | 2398d3465cc8b745c22b421564d89a8354f0150f (patch) | |
tree | f3467ec710200764f916696ccf7b79b2a30e19a6 | |
parent | 3b37aa2a869652b2718b399ad0a4831e263023b3 (diff) | |
download | rspamd-2398d3465cc8b745c22b421564d89a8354f0150f.tar.gz rspamd-2398d3465cc8b745c22b421564d89a8354f0150f.zip |
[Minor] Selectors: Sigh, another try to fix .last
-rw-r--r-- | lualib/lua_selectors/transforms.lua | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/lualib/lua_selectors/transforms.lua b/lualib/lua_selectors/transforms.lua index b6fc0a001..b0c912deb 100644 --- a/lualib/lua_selectors/transforms.lua +++ b/lualib/lua_selectors/transforms.lua @@ -54,13 +54,7 @@ local transform_function = { ['list'] = true, }, ['process'] = function(inp, t) - local gen,param,state = fun.iter(inp) - local prev_state - repeat - prev_state = state - state = gen(param, state) - until state == nil - return prev_state,pure_type(t) + return fun.nth(fun.length(inp), inp),pure_type(t) end, ['description'] = 'Returns the last element', }, |