commit 3b37aa2: [Minor] Selectors: Try to fix last transformation
Vsevolod Stakhov
vsevolod at highsecure.ru
Wed Dec 11 18:21:06 UTC 2019
Author: Vsevolod Stakhov
Date: 2019-12-11 17:32:46 +0000
URL: https://github.com/rspamd/rspamd/commit/3b37aa2a869652b2718b399ad0a4831e263023b3
[Minor] Selectors: Try to fix last transformation
---
lualib/lua_selectors/transforms.lua | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/lualib/lua_selectors/transforms.lua b/lualib/lua_selectors/transforms.lua
index ffc9acd00..b6fc0a001 100644
--- a/lualib/lua_selectors/transforms.lua
+++ b/lualib/lua_selectors/transforms.lua
@@ -54,7 +54,13 @@ local transform_function = {
['list'] = true,
},
['process'] = function(inp, t)
- return fun.nth(#inp, inp),pure_type(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)
end,
['description'] = 'Returns the last element',
},
More information about the Commits
mailing list