Skip to content

Commit 411a1de

Browse files
committed
remove unnecessary itemgetter import and use a lambda with [] instead of .get (for typing purposes)
1 parent ba6850e commit 411a1de

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

bot/exts/utils/tunnel.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from operator import itemgetter
2-
31
import discord
42
from discord.ext import commands
53
from discord.ext.commands import BadArgument
@@ -87,7 +85,7 @@ def get_least_active_channel_id(self, current_channel_id: int) -> int:
8785
"""Gets least active off-topic channel."""
8886
return min(
8987
(channel for channel in self.channel_id_to_timestamp if channel != current_channel_id),
90-
key=self.channel_id_to_timestamp.get
88+
key=lambda c: self.channel_id_to_timestamp[c]
9189
)
9290

9391

0 commit comments

Comments
 (0)