From 978e8de69f1f5303bf9d9b24f764d890d73c927f Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 27 Apr 2005 11:50:16 +0000 Subject: Optimized stuff git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1212 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/wildcard.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/wildcard.cpp') diff --git a/src/wildcard.cpp b/src/wildcard.cpp index 123abc500..56df22368 100644 --- a/src/wildcard.cpp +++ b/src/wildcard.cpp @@ -47,13 +47,15 @@ int I,I2; if (MWC) return true; -if ((strstr(mask,"*")==0) && (strlen(literal) != strlen(mask))) +int lenliteral = strlen(literal); + +if ((strchr(mask,'*')==0) && (lenliteral != (strlen(mask)))) return 0; I=0; I2=0; while (I < strlen(mask)) { - if (I2 >= strlen(literal)) + if (I2 >= lenliteral) return 0; if ((mask[I]=='*') && (MWC==0)) @@ -87,7 +89,7 @@ if ((strstr(mask,"*")==0) && (strlen(literal) != strlen(mask))) I++; I2++; } - if (strlen(literal)==strlen(mask)) + if (lenliteral==strlen(mask)) MWC=2; } -- cgit v1.2.3