]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/grob-array.cc
Run `make grand-replace'.
[lilypond.git] / lily / grob-array.cc
index 1656fc821f44e4813e806c2ea0dcb3b1ae189307..281ae61e27cd71aa55342e6400fc8f3eb317ed09 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2005--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 2005--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "grob-array.hh"
@@ -26,7 +26,7 @@ Grob_array::spanner (vsize i)
 
 Grob_array::Grob_array ()
 {
-  ordered_ = false;
+  ordered_ = true;
 }
 
 vector<Grob*> &
@@ -82,6 +82,15 @@ Grob_array::clear ()
   grobs_.clear ();
 }
 
+void
+Grob_array::remove_duplicates ()
+{
+  assert (!ordered_);
+  
+  vector_sort (grobs_, less<Grob*> ());
+  ::uniq (grobs_);
+}
+
 bool
 Grob_array::empty () const
 {
@@ -108,3 +117,4 @@ grob_list_to_grob_array (SCM lst)
     ga->add (unsmob_grob (scm_car (s)));
   return arr_scm;
 }
+