mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 19:19:32 +01:00
Optimization to hostmaskPatternEqual.
This commit is contained in:
parent
a46476a9ca
commit
c746f9459b
@ -112,9 +112,10 @@ def isChannel(s):
|
|||||||
return (s and s[0] in '#&+!' and len(s) <= 50 and \
|
return (s and s[0] in '#&+!' and len(s) <= 50 and \
|
||||||
'\x07' not in s and ',' not in s and ' ' not in s)
|
'\x07' not in s and ',' not in s and ' ' not in s)
|
||||||
|
|
||||||
|
_match = fnmatch.fnmatchcase
|
||||||
def hostmaskPatternEqual(pattern, hostmask):
|
def hostmaskPatternEqual(pattern, hostmask):
|
||||||
"""Returns True if hostmask matches the hostmask pattern pattern."""
|
"""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 + '.'
|
_ipchars = string.digits + '.'
|
||||||
def isIP(s):
|
def isIP(s):
|
||||||
|
Loading…
Reference in New Issue
Block a user