mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-03 01:39:23 +01:00
Added __slots__ to IrcDict and IrcSet for optimization purposes.
This commit is contained in:
parent
7081d64124
commit
6084d00067
@ -334,6 +334,7 @@ class IrcString(str):
|
||||
|
||||
class IrcDict(dict):
|
||||
"""Subclass of dict to make key comparison IRC-case insensitive."""
|
||||
__slots__ = ()
|
||||
def __contains__(self, s):
|
||||
return dict.__contains__(self, IrcString(s))
|
||||
has_key = __contains__
|
||||
@ -348,6 +349,7 @@ class IrcDict(dict):
|
||||
dict.__delitem__(self, IrcString(s))
|
||||
|
||||
class IrcSet(sets.Set):
|
||||
__slots__ = ()
|
||||
def add(self, s):
|
||||
return sets.Set.add(self, IrcString(s))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user