Mercurial > octave-nkf
diff liboctave/str-vec.cc @ 8678:e2b4c19c455c
redo changeset 4238f2600a17 with fixes to sorting
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Wed, 04 Feb 2009 16:05:01 +0100 |
parents | d7128ae51e44 |
children | eb63fbe60fab |
line wrap: on
line diff
--- a/liboctave/str-vec.cc Thu Feb 05 02:42:58 2009 -0500 +++ b/liboctave/str-vec.cc Wed Feb 04 16:05:01 2009 +0100 @@ -84,6 +84,18 @@ } string_vector& +string_vector::sort (bool make_uniq) +{ + // Don't use Array<std::string>::sort () to allow sorting in place. + octave_sort<std::string> lsort; + lsort.sort (Array<std::string>::fortran_vec (), length ()); + + if (make_uniq) + uniq (); + + return *this; +} +string_vector& string_vector::uniq (void) { octave_idx_type len = length ();