Optimise utils.find and specialise utils.as_chunks

This commit is contained in:
Sacul
2025-11-19 08:51:27 +08:00
committed by GitHub
parent c342db8534
commit 9be91cb093
2 changed files with 16 additions and 13 deletions

View File

@@ -821,7 +821,7 @@ class GuildChannel:
if obj.is_default():
return base
overwrite = utils.get(self._overwrites, type=_Overwrites.ROLE, id=obj.id)
overwrite = utils.find(lambda ow: ow.type == _Overwrites.ROLE and ow.id == obj.id, self._overwrites)
if overwrite is not None:
base.handle_overwrite(overwrite.allow, overwrite.deny)