Mercurial > hg > octave-terminal
changeset 8671:d7128ae51e44
undo changeset 4238f2600a17
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 04 Feb 2009 15:53:24 -0500 |
parents | 6f5b2835325c |
children | 2a49c32d4322 |
files | liboctave/Array-str.cc liboctave/ChangeLog liboctave/str-vec.cc liboctave/str-vec.h |
diffstat | 4 files changed, 11 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/Array-str.cc +++ b/liboctave/Array-str.cc @@ -24,14 +24,14 @@ #include <config.h> #endif -#include <string> - // Instantiate Arrays of strings. #include "Array.h" #include "Array.cc" #include "oct-sort.cc" +#include <string> + INSTANTIATE_ARRAY_SORT (std::string); INSTANTIATE_ARRAY (std::string, OCTAVE_API);
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,9 +1,3 @@ -2009-02-04 Jaroslav Hajek <highegg@gmail.com> - - * str-vec.h (string_vector::sort): Remove implementation. - * str-vec.cc (string_vector::sort): Move here. Use in-place sorting. - * Array-str.cc: Fix order of header files. - 2009-02-04 Jaroslav Hajek <highegg@gmail.com> * oct-locbuf.h: Specialize OCTAVE_LOCAL_BUFFER to use chunked
--- a/liboctave/str-vec.cc +++ b/liboctave/str-vec.cc @@ -84,18 +84,6 @@ } 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 ();
--- a/liboctave/str-vec.h +++ b/liboctave/str-vec.h @@ -84,7 +84,15 @@ std::string operator[] (octave_idx_type i) const { return Array<std::string>::elem (i); } - string_vector& sort (bool make_uniq = false); + string_vector& sort (bool make_uniq = false) + { + Array<std::string>::sort (); + + if (make_uniq) + uniq (); + + return *this; + } string_vector& uniq (void);