Skip to content

Commit dd7d4b8

Browse files
committed
Use a thread values view when constructing TextChannel.threads
Avoids an accidental O(n^2) situation.
1 parent 2d8f299 commit dd7d4b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

discord/channel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def threads(self) -> List[Thread]:
230230
231231
.. versionadded:: 2.0
232232
"""
233-
return [thread for thread in self.guild.threads if thread.parent_id == self.id]
233+
return [thread for thread in self.guild._threads.values() if thread.parent_id == self.id]
234234

235235
def is_nsfw(self) -> bool:
236236
""":class:`bool`: Checks if the channel is NSFW."""

0 commit comments

Comments
 (0)