]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/spacing-spanner.cc
Issue 2491: Macro for(UP_and_DOWN) and 3 similar.
[lilypond.git] / lily / spacing-spanner.cc
index 1af0ba372075b8746c3eb7c438d03b61129fc088..657ff0cd6a9d2b6541b87bfdd8f6a789dbdcf13b 100644 (file)
@@ -261,8 +261,7 @@ set_column_rods (vector<Grob *> const &cols, Real padding)
           Real left_stickout = skys ? (*skys)[RIGHT].max_height () : 0.0;
           bool done = true;
 
-          Direction d = LEFT;
-          do
+          for (LEFT_and_RIGHT (d))
             {
               if (j < i - 1)
                 cur_dist[d] += distances[j];
@@ -287,8 +286,10 @@ set_column_rods (vector<Grob *> const &cols, Real padding)
 
               cur_dist[d] = max (cur_dist[d], dist);
               done = done && !touches;
+
+              if (!rb)
+                break;
             }
-          while (flip (&d) != LEFT && rb);
 
           /* we need the empty check for gregorian notation, where there are a lot of
              extraneous paper-columns that we need to skip over */