- qsort (vec, it_index,
- sizeof (Substitution_entry), &Substitution_entry::item_compare);
-
- Array<Slice> *arrs[] = {
- &it_indices, &sp_indices
- };
-
- for (int i = 0; i < it_index ;i++)
- {
- for (int j = vec[i].left_; j <= vec[i].right_; j++)
- {
- it_indices[j - system_range[LEFT]].add_point (i);
- }
- }
-
- /*
- sorting vec[sp_index.. len]
- is a waste of time -- the staff-spanners screw up the
- ordering, since they go across the entire score.
- */
- for (int i = sp_indices.size (); i--;)
- sp_indices[i]= Slice (sp_index, len-1);
-
-
- assert (it_index <= sp_index);
-
- assert (broken_intos_.size () == system_range.length () + 1);
- for (int i = 0; i < broken_intos_.size (); i++)
+ qsort (vec, item_index,
+ sizeof (Substitution_entry), &Substitution_entry::item_compare);
+
+ vector<Slice> item_indices;
+ vector<Slice> spanner_indices;
+ for (int i = 0; i <= system_range.length (); i++)
+ {
+ item_indices.push_back (Slice (len, 0));
+ spanner_indices.push_back (Slice (len, 0));
+ }
+
+ vector<Slice> *arrs[]
+ =
+ {
+ &item_indices, &spanner_indices
+ };
+
+ for (int i = 0; i < item_index; i++)
+ {
+ for (int j = vec[i].left_; j <= vec[i].right_; j++)
+ item_indices[j - system_range[LEFT]].add_point (i);
+ }
+
+ /*
+ sorting vec[spanner_index.. len]
+ is a waste of time -- the staff-spanners screw up the
+ ordering, since they go across the entire score.
+ */
+ for (vsize i = spanner_indices.size (); i--;)
+ spanner_indices[i] = Slice (spanner_index, len - 1);
+
+ assert (item_index <= spanner_index);
+
+ assert ((broken_intos_.size () == (vsize)system_range.length () + 1)
+ || (broken_intos_.empty () && system_range.length () == 0));
+ for (vsize i = 0; i < broken_intos_.size (); i++)