From 2398d3465cc8b745c22b421564d89a8354f0150f Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 11 Dec 2019 18:17:16 +0000 Subject: [PATCH] [Minor] Selectors: Sigh, another try to fix .last --- lualib/lua_selectors/transforms.lua | 8 +------- 1 file changed, 1 insertion(+), 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', }, -- 2.39.5