# HG changeset patch # User John W. Eaton # Date 1233780804 18000 # Node ID d7128ae51e44f4f5547e7481f3f5e3cb9f4a34ad # Parent 6f5b2835325cd17552ea2f5f085c066f1518a45f undo changeset 4238f2600a17 diff --git a/liboctave/Array-str.cc b/liboctave/Array-str.cc --- a/liboctave/Array-str.cc +++ b/liboctave/Array-str.cc @@ -24,14 +24,14 @@ #include #endif -#include - // Instantiate Arrays of strings. #include "Array.h" #include "Array.cc" #include "oct-sort.cc" +#include + INSTANTIATE_ARRAY_SORT (std::string); INSTANTIATE_ARRAY (std::string, OCTAVE_API); diff --git a/liboctave/ChangeLog b/liboctave/ChangeLog --- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,9 +1,3 @@ -2009-02-04 Jaroslav Hajek - - * 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 * oct-locbuf.h: Specialize OCTAVE_LOCAL_BUFFER to use chunked diff --git a/liboctave/str-vec.cc b/liboctave/str-vec.cc --- 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::sort () to allow sorting in place. - octave_sort lsort; - lsort.sort (Array::fortran_vec (), length ()); - - if (make_uniq) - uniq (); - - return *this; -} -string_vector& string_vector::uniq (void) { octave_idx_type len = length (); diff --git a/liboctave/str-vec.h b/liboctave/str-vec.h --- a/liboctave/str-vec.h +++ b/liboctave/str-vec.h @@ -84,7 +84,15 @@ std::string operator[] (octave_idx_type i) const { return Array::elem (i); } - string_vector& sort (bool make_uniq = false); + string_vector& sort (bool make_uniq = false) + { + Array::sort (); + + if (make_uniq) + uniq (); + + return *this; + } string_vector& uniq (void);