Unverified Commit b825f798 authored by mvdbeek's avatar mvdbeek
Browse files

Reduce for loop nesting

parent 023178db
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
workflow steps.
"""
import math
from itertools import chain

from galaxy.util.topsort import (
    CycleError,
@@ -65,8 +66,7 @@ def order_workflow_steps(steps, comments):
                min_top = min(min_top_comments, min_top)

            # normalize comments by min_left and min_top
            for comment_list in [sortable_comments, freehand_comments]:
                for comment in comment_list:
            for comment in chain(sortable_comments, freehand_comments):
                comment.position = [comment.position[0] - min_left, comment.position[1] - min_top]

            # order by Euclidean distance to the origin