diff mod_firewall/conditions.lib.lua @ 2074:86427261e3c4

mod_firewall: Use string.find in JID match, faster since the result is unused
author Kim Alvefur <zash@zash.se>
date Fri, 11 Mar 2016 18:18:35 +0100
parents de15606f3669
children baa1cb349427
line wrap: on
line diff
--- 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