X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fbreak-substitution.cc;h=d198753d673b88bda66d51e8029259f9d4307681;hb=90e4d7057f3857da049dfda3d130017d4719bd6b;hp=c465979fb7f5f9abb53a809b523842b321f6023e;hpb=24107d843c902a8101fbb696f47bf7538dd4493a;p=lilypond.git diff --git a/lily/break-substitution.cc b/lily/break-substitution.cc index c465979fb7..d198753d67 100644 --- a/lily/break-substitution.cc +++ b/lily/break-substitution.cc @@ -147,34 +147,6 @@ again: return src; } -/* - Perform substitution on GROB_LIST using a constant amount of stack. -*/ -vector temporary_substition_array; -void -substitute_grob_array (Grob_array *grob_arr, Grob_array *new_arr) -{ - vector &old_grobs (grob_arr->array_reference ()); - vector *new_grobs (new_arr == grob_arr - ? & temporary_substition_array - : &new_arr->array_reference ()); - - new_grobs->resize (old_grobs.size ()); - Grob **array = (Grob **) new_grobs->data (); - Grob **ptr = array; - for (vsize i = 0; i < old_grobs.size (); i++) - { - Grob *orig = old_grobs[i]; - Grob *new_grob = substitute_grob (orig); - if (new_grob) - *ptr++ = new_grob; - } - - new_grobs->resize (ptr - array); - if (new_arr == grob_arr) - new_arr->set_array (*new_grobs); -} - /* We don't do @@ -470,8 +442,8 @@ substitute_object_alist (SCM alist, SCM dest) : Grob_array::make_array (); Grob_array *new_arr = unsmob (newval); - - substitute_grob_array (orig, new_arr); + // TODO: What if new_arr is null? + new_arr->filter_map_assign (*orig, substitute_grob); val = newval; } else @@ -516,7 +488,8 @@ Spanner::substitute_one_mutable_property (SCM sym, newval = Grob_array::make_array (); sc->set_object (sym, newval); } - substitute_grob_array (grob_array, unsmob (newval)); + Grob_array *new_arr = unsmob (newval); + new_arr->filter_map_assign (*grob_array, substitute_grob); } else {