зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1653030 - Make 'All' optimization strategy return early as soon as one of its substrategies returns False. r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D83715
This commit is contained in:
Родитель
4ccaec8564
Коммит
ab73b2650b
|
@ -373,10 +373,10 @@ class All(CompositeStrategy):
|
|||
|
||||
@classmethod
|
||||
def reduce(cls, results):
|
||||
rvs = list(results)
|
||||
if all(rvs):
|
||||
return rvs[0]
|
||||
return False
|
||||
for rv in results:
|
||||
if !rv:
|
||||
return rv
|
||||
return True
|
||||
|
||||
|
||||
class Alias(CompositeStrategy):
|
||||
|
|
Загрузка…
Ссылка в новой задаче