aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_admin_telnet.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-09-30 14:55:15 +0200
committerKim Alvefur <zash@zash.se>2018-09-30 14:55:15 +0200
commit03b285fc261314057ef6cfec7efbf97aa70a9275 (patch)
tree91caa88e23ad37fccee874e6f3aef07e0394e124 /plugins/mod_admin_telnet.lua
parentd334d70ca671f3a4e59dac5a43cb76c88562eda8 (diff)
downloadprosody-03b285fc261314057ef6cfec7efbf97aa70a9275.tar.gz
prosody-03b285fc261314057ef6cfec7efbf97aa70a9275.zip
mod_admin_telnet: Create metatable only once
Diffstat (limited to 'plugins/mod_admin_telnet.lua')
-rw-r--r--plugins/mod_admin_telnet.lua3
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)