From c746f9459be1b3077e1a843f6425ae188ca437a8 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Wed, 5 Nov 2003 22:21:43 +0000 Subject: [PATCH] Optimization to hostmaskPatternEqual. --- src/ircutils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ircutils.py b/src/ircutils.py index f94cad35f..e233363d6 100644 --- a/src/ircutils.py +++ b/src/ircutils.py @@ -112,9 +112,10 @@ def isChannel(s): return (s and s[0] in '#&+!' and len(s) <= 50 and \ '\x07' not in s and ',' not in s and ' ' not in s) +_match = fnmatch.fnmatchcase def hostmaskPatternEqual(pattern, hostmask): """Returns True if hostmask matches the hostmask pattern pattern.""" - return fnmatch.fnmatch(toLower(hostmask), toLower(pattern)) + return _match(toLower(hostmask), toLower(pattern)) _ipchars = string.digits + '.' def isIP(s):