lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] beam: remove unnecessary vector of forbidden intervals


From: Jean Abou Samra
Subject: Re: [PATCH] beam: remove unnecessary vector of forbidden intervals
Date: Sun, 17 Apr 2022 10:02:20 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0



Le 17/04/2022 à 06:22, Nihal Jere a écrit :
The same vector is constructed twice, so just do it once.
---
Not sure if this is the right place to send patches, but here it is.

  lily/beam.cc | 6 +-----
  1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/lily/beam.cc b/lily/beam.cc
index 340d9fe1a1..dbb9c186c5 100644
--- a/lily/beam.cc
+++ b/lily/beam.cc
@@ -880,8 +880,6 @@ Beam::consider_auto_knees (Grob *me)
    if (!scm_is_number (scm))
      return;
- vector<Interval> forbidden_intervals;
-
    extract_grob_set (me, "normal-stems", stems);
Grob *common = common_refpoint_of_array (stems, me, Y_AXIS);
@@ -913,15 +911,13 @@ Beam::consider_auto_knees (Grob *me)
              }
          }
        head_extents_array.push_back (head_extents);
-
-      forbidden_intervals.push_back (head_extents);
      }
Interval max_gap;
    Real max_gap_len = 0.0;
vector<Interval> allowed_regions
-    = Interval_set::interval_union (forbidden_intervals).complement 
().intervals ();
+    = Interval_set::interval_union (head_extents_array).complement 
().intervals ();
    for (vsize i = allowed_regions.size () - 1; i != VPOS; i--)
      {
        Interval gap = allowed_regions[i];



Thanks, and welcome. The Contributor's Guide explains how to upload a patch on GitLab.

https://lilypond.org/doc/v2.23/Documentation/contributor/working-with-source-code

Best,
Jean



reply via email to

[Prev in Thread] Current Thread [Next in Thread]