Skip to content

Commit

Permalink
Sort branches by completion
Browse files Browse the repository at this point in the history
  • Loading branch information
nickdrozd committed Dec 1, 2023
1 parent 8b2152c commit fe7f869
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tm/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,13 @@ def distribute_branches(branches: list[Prog]) -> list[list[Prog]]:

for i in range(cpus):
end = start + size + (1 if i < rem else 0)
result.append(branches[start:end])
result.append(
sorted(
branches[ start : end ],
key = lambda branch: branch.count('...'),
reverse = True,
)
)
start = end

return result
Expand Down

0 comments on commit fe7f869

Please sign in to comment.