mirror of
https://github.com/beetbox/beets.git
synced 2025-12-28 19:42:42 +01:00
Use short-circuit evaluation in AndQuery and OrQuery (fix #4145)
This commit is contained in:
parent
f3552f09cf
commit
5e6be0ddb3
2 changed files with 5 additions and 2 deletions
|
|
@ -443,7 +443,7 @@ class AndQuery(MutableCollectionQuery):
|
|||
return self.clause_with_joiner('and')
|
||||
|
||||
def match(self, item):
|
||||
return all([q.match(item) for q in self.subqueries])
|
||||
return all(q.match(item) for q in self.subqueries)
|
||||
|
||||
|
||||
class OrQuery(MutableCollectionQuery):
|
||||
|
|
@ -453,7 +453,7 @@ class OrQuery(MutableCollectionQuery):
|
|||
return self.clause_with_joiner('or')
|
||||
|
||||
def match(self, item):
|
||||
return any([q.match(item) for q in self.subqueries])
|
||||
return any(q.match(item) for q in self.subqueries)
|
||||
|
||||
|
||||
class NotQuery(Query):
|
||||
|
|
|
|||
|
|
@ -73,6 +73,9 @@ Bug fixes:
|
|||
* :doc:`/dev/library`: Use slow queries for flexible attributes in aunique.
|
||||
:bug:`2678` :bug:`3553`
|
||||
|
||||
* :doc:`/reference/query`: Use short-circuit evaluation in AndQuery and OrQuery
|
||||
:bug:`4145`
|
||||
|
||||
1.5.0 (August 19, 2021)
|
||||
-----------------------
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue