# HG changeset patch # User Kim Alvefur # Date 1538312115 -7200 # Node ID 7355b2d0067c1603461cc56662932c1fc6e2946c # Parent 521df71b263068d0ca927d6907add74f63acdf48 mod_admin_telnet: Create metatable only once diff -r 521df71b2630 -r 7355b2d0067c plugins/mod_admin_telnet.lua --- a/plugins/mod_admin_telnet.lua Sun Sep 30 14:54:51 2018 +0200 +++ b/plugins/mod_admin_telnet.lua Sun Sep 30 14:55:15 2018 +0200 @@ -1483,8 +1483,9 @@ return #stats.." statistics displayed"; end +local stats_mt = {__index = stats_methods, __tostring = stats_tostring } local function new_stats_context(self) - return setmetatable({ session = self.session, stats = true }, {__index = stats_methods, __tostring = stats_tostring }); + return setmetatable({ session = self.session, stats = true }, stats_mt); end function def_env.stats:show(filter)