summaryrefslogtreecommitdiff
path: root/src/wildcard.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-27 11:50:16 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-27 11:50:16 +0000
commit978e8de69f1f5303bf9d9b24f764d890d73c927f (patch)
tree1c584849a6d4d0a77911f1cbd3fda68a01f361e8 /src/wildcard.cpp
parenteb04595b0b184f0593ca85af04f4f074cd2f69d2 (diff)
Optimized stuff
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1212 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/wildcard.cpp')
-rw-r--r--src/wildcard.cpp8
1 files changed, 5 insertions, 3 deletions
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;
}