Software /
code /
prosody
Changeset
9410:7355b2d0067c
mod_admin_telnet: Create metatable only once
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 30 Sep 2018 14:55:15 +0200 |
parents | 9409:521df71b2630 |
children | 9411:62c876e333e4 |
files | plugins/mod_admin_telnet.lua |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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)