mod_muc_rtbl: Optimize case with zero hashes
On the assumption that during quiet times between torrents of spam,
the hash set would be empty. There would be no point in doing the
operations and hashes to check for a match in that case.
--- a/mod_muc_rtbl/mod_muc_rtbl.lua Mon Dec 06 12:27:16 2021 +0000
+++ b/mod_muc_rtbl/mod_muc_rtbl.lua Mon Dec 06 18:19:19 2021 +0100
@@ -92,6 +92,8 @@
module:hook("iq-result/host/rtbl-request", update_list);
module:hook("muc-occupant-pre-join", function (event)
+ if next(banned_hashes) == nil then return end
+
local from_bare = jid.bare(event.stanza.attr.from);
local affiliation = event.room:get_affiliation(from_bare);