From 1943c0a2fc7538cbd795d981da1d05764fc00a81 Mon Sep 17 00:00:00 2001 From: dmiller Date: Wed, 30 Dec 2020 23:31:35 +0000 Subject: [PATCH] Simplify output_table __index metamethod From Lua 5.3 docs: "Despite the name, the metamethod for this event can be either a function or a table. [...] If it is a table, the final result is the result of indexing this table with key." --- nselib/stdnse.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nselib/stdnse.lua b/nselib/stdnse.lua index c18013250..79b512864 100644 --- a/nselib/stdnse.lua +++ b/nselib/stdnse.lua @@ -959,9 +959,7 @@ function output_table () end rawset(t, k, v) end, - __index = function (_, k) - return t[k] - end, + __index = t, __pairs = function (_) return coroutine.wrap(iterator) end,