diff options
| author | Rapptz <[email protected]> | 2021-08-25 20:42:21 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2021-08-25 20:42:21 -0400 |
| commit | dd7d4b8e7f2e5c37cd7dcf49a8030f35eed51aa0 (patch) | |
| tree | 6f1922685ccb62723eff27684313fcddd8915231 /discord/channel.py | |
| parent | Use MISSING instead of None for HelpCommand.context (diff) | |
| download | discord.py-dd7d4b8e7f2e5c37cd7dcf49a8030f35eed51aa0.tar.xz discord.py-dd7d4b8e7f2e5c37cd7dcf49a8030f35eed51aa0.zip | |
Use a thread values view when constructing TextChannel.threads
Avoids an accidental O(n^2) situation.
Diffstat (limited to 'discord/channel.py')
| -rw-r--r-- | discord/channel.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/discord/channel.py b/discord/channel.py index 2ac4f693..6e025a99 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -230,7 +230,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable): .. versionadded:: 2.0 """ - return [thread for thread in self.guild.threads if thread.parent_id == self.id] + return [thread for thread in self.guild._threads.values() if thread.parent_id == self.id] def is_nsfw(self) -> bool: """:class:`bool`: Checks if the channel is NSFW.""" |