# HG changeset patch # User Kim Alvefur # Date 1457716715 -3600 # Node ID 86427261e3c4c347846ab15f5e8f0f4e21174428 # Parent de15606f3669e632830e42ddeee962a01ac2aecf mod_firewall: Use string.find in JID match, faster since the result is unused diff -r de15606f3669 -r 86427261e3c4 mod_firewall/conditions.lib.lua --- a/mod_firewall/conditions.lib.lua Fri Mar 11 18:18:04 2016 +0100 +++ b/mod_firewall/conditions.lib.lua Fri Mar 11 18:18:35 2016 +0100 @@ -33,7 +33,7 @@ else pattern = pattern:gsub("%p", "%%%0"):gsub("%%(%p)", wildcard_equivs); end - return ("(%s and %s:match(%q))"):format(part, part, "^"..pattern.."$"); + return ("(%s and %s:find(%q))"):format(part, part, "^"..pattern.."$"); else return ("%s == %q"):format(part, match); end