# HG changeset patch # User Kim Alvefur # Date 1638811159 -3600 # Node ID 0a257d1402c36a1099797d6c5796fba48cb78971 # Parent 9cdbb1b5e6f2c91637e66158de833a23fe2c1a9b 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. diff -r 9cdbb1b5e6f2 -r 0a257d1402c3 mod_muc_rtbl/mod_muc_rtbl.lua --- 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);