# HG changeset patch # User Emmanuel Gil Peyrot # Date 1581972555 -3600 # Node ID 96a2e5097fc4c8d61fd9303546146e39def66054 # Parent 38504ec4c89b925c86ded2deed9eb5e58bf75ca0 mod_http_muc_log: Reduce hashtable lookups diff -r 38504ec4c89b -r 96a2e5097fc4 mod_http_muc_log/mod_http_muc_log.lua --- a/mod_http_muc_log/mod_http_muc_log.lua Mon Feb 17 16:42:24 2020 +0100 +++ b/mod_http_muc_log/mod_http_muc_log.lua Mon Feb 17 21:49:15 2020 +0100 @@ -255,10 +255,11 @@ -- Phew, all wrangled, all that's left is rendering it with the template response.headers.content_type = "text/html; charset=utf-8"; + local room_obj = get_room(room); return render(template, { - room = get_room(room)._data; - jid = get_room(room).jid; - jid_node = jid_split(get_room(room).jid); + room = room_obj._data; + jid = room_obj.jid; + jid_node = jid_split(room_obj.jid); hide_presence = hide_presence(request); presence_available = presence_logged; dates = date_list; @@ -391,14 +392,15 @@ end response.headers.content_type = "text/html; charset=utf-8"; + local room_obj = get_room(room); return render(template, { date = date; - room = get_room(room)._data; - jid = get_room(room).jid; - jid_node = jid_split(get_room(room).jid); + room = room_obj._data; + jid = room_obj.jid; + jid_node = jid_split(room_obj.jid); hide_presence = hide_presence(request); presence_available = presence_logged; - lang = get_room(room).get_language and get_room(room):get_language(); + lang = room_obj.get_language and room_obj:get_language(); lines = logs; links = links; dates = {}; -- COMPAT util.interpolation {nil|func#...} bug