mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-24 05:25:17 +00:00
[red-knot] micro-optimise ClassLiteral::is_protocol
(#17703)
This commit is contained in:
parent
c953e7d143
commit
31e6576971
1 changed files with 1 additions and 1 deletions
|
@ -534,7 +534,7 @@ impl<'db> ClassLiteral<'db> {
|
|||
|
||||
/// Determine if this class is a protocol.
|
||||
pub(super) fn is_protocol(self, db: &'db dyn Db) -> bool {
|
||||
self.explicit_bases(db).iter().any(|base| {
|
||||
self.explicit_bases(db).iter().rev().take(3).any(|base| {
|
||||
matches!(
|
||||
base,
|
||||
Type::KnownInstance(KnownInstanceType::Protocol)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue