From 4f2e3ec05b258d039c67f830dc976e2ebaa3a9f4 Mon Sep 17 00:00:00 2001 From: deadzilla Date: Wed, 22 Jul 2026 22:29:38 +0500 Subject: [PATCH] =?UTF-8?q?fix:=20=D0=B7=D0=B0=D0=BC=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20list=20comprehension=20=D0=BD=D0=B0=20generator?= =?UTF-8?q?=20=D0=B2=20stats.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit len([ch for ch in ...]) создавал временный список. Заменено на sum(1 for ch in ...) — без выделения памяти под промежуточный список. --- commands/stats.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/commands/stats.py b/commands/stats.py index 044364f..41dfcc2 100644 --- a/commands/stats.py +++ b/commands/stats.py @@ -14,12 +14,10 @@ class Stats(commands.Cog): guilds = ctx.bot.guilds total_guilds = len(guilds) total_channels = sum( - len( - [ - ch - for ch in guild.channels - if not isinstance(ch, discord.CategoryChannel) - ] + sum( + 1 + for ch in guild.channels + if not isinstance(ch, discord.CategoryChannel) ) for guild in guilds )