diff options
author | Kim Alvefur <zash@zash.se> | 2018-09-30 14:55:15 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-09-30 14:55:15 +0200 |
commit | 1fd061af59f7c5f0e1f07b7b6a4b717d08c6dd16 (patch) | |
tree | 91caa88e23ad37fccee874e6f3aef07e0394e124 /plugins | |
parent | eb580b9f2bfbcdd547a2cecc0e92a453476de409 (diff) | |
download | prosody-1fd061af59f7c5f0e1f07b7b6a4b717d08c6dd16.tar.gz prosody-1fd061af59f7c5f0e1f07b7b6a4b717d08c6dd16.zip |
mod_admin_telnet: Create metatable only once
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_admin_telnet.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua index 41595540..85fb0d6c 100644 --- a/plugins/mod_admin_telnet.lua +++ b/plugins/mod_admin_telnet.lua @@ -1483,8 +1483,9 @@ local function stats_tostring(stats) 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) |