Use slots where possible for a marginal memory save
This commit is contained in:
1 parent
0dc8313188
commit
4788ac8fbf
2 files changed
+5
-1
No files matched your search
+3
-1
@@ -21,6 +21,8 @@ logger = logging.getLogger("TwitchDrops")
|
||||
|
||||
|
||||
class Stream:
|
||||
__slots__ = ("channel", "broadcast_id", "viewers", "drops_enabled", "game", "title")
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
channel: Channel,
|
||||
@@ -180,7 +182,7 @@ class Channel:
|
||||
|
||||
@property
|
||||
def game(self) -> Game | None:
|
||||
if self._stream is not None and self._stream.game is not None:
|
||||
if self._stream is not None:
|
||||
return self._stream.game
|
||||
return None
|
||||
|
||||
|
||||
Reference in new issue
Block a user