Skip to content

Commit

Permalink
Combine nested ifs into a single one
Browse files Browse the repository at this point in the history
  • Loading branch information
jakirkham committed Feb 9, 2021
1 parent f983ac2 commit 5d6b834
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions distributed/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -6838,9 +6838,8 @@ def decide_worker(
candidates = set(all_workers)
else:
candidates = {ws for dts in deps for ws in dts._who_has}
if valid_workers is None:
if not candidates:
candidates = set(all_workers)
if valid_workers is None and not candidates:
candidates = set(all_workers)
else:
candidates &= valid_workers
if not candidates:
Expand Down

0 comments on commit 5d6b834

Please sign in to comment.