changeset 1697:27aa58ed3e2e

mod_block_registrations: string.find is faster than string.match when only needing a boolean answer
author Kim Alvefur <zash@zash.se>
date Tue, 05 May 2015 15:31:11 +0200
parents efc1d674eac0
children 55bc42c1d8c5
files mod_block_registrations/mod_block_registrations.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_block_registrations/mod_block_registrations.lua	Tue May 05 14:21:13 2015 +0100
+++ b/mod_block_registrations/mod_block_registrations.lua	Tue May 05 15:31:11 2015 +0200
@@ -10,7 +10,7 @@
         if block_users:contains(username) then return true; end
 
         for pattern in block_patterns do
-                if username:match(pattern) then
+                if username:find(pattern) then
                         return true;
                 end
         end