1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-08 07:29:03 +00:00

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."
This commit is contained in:
dmiller
2020-12-30 23:31:35 +00:00
parent e7b40571ef
commit 1943c0a2fc

View File

@@ -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,