Mercurial > hg > octave-terminal
changeset 6816:ec4c1dfb985a
[project @ 2007-08-15 04:45:39 by jwe]
author | jwe |
---|---|
date | Wed, 15 Aug 2007 04:45:39 +0000 |
parents | fa3c21cdf3bc |
children | 2e7f62e52c13 |
files | src/ChangeLog src/ov-str-mat.cc |
diffstat | 2 files changed, 5 insertions(+), 28 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,8 +1,3 @@ -2007-08-14 John W. Eaton <jwe@octave.org> - - * ov-str-mat.cc (octave_char_matrix_str::all_strings): - If empty, return a single element string vector containing "". - 2007-08-10 John W. Eaton <jwe@octave.org> * pt-idx.cc (tree_index_expression::get_struct_index): Improve
--- a/src/ov-str-mat.cc +++ b/src/ov-str-mat.cc @@ -229,32 +229,14 @@ if (matrix.ndims () == 2) { - // FIXME -- is this the best behavior possible? It does provide - // compatible behavior for things like - // - // cellstr ("") - // cellstr (char (zeros ((2, 0))) - // cellstr (char (zeros ((0, 2))) - // - // etc. + charMatrix chm = matrix.matrix_value (); - if (is_empty ()) - { - retval.resize (1); + octave_idx_type n = chm.rows (); - retval[0] = ""; - } - else - { - charMatrix chm = matrix.matrix_value (); + retval.resize (n); - octave_idx_type n = chm.rows (); - - retval.resize (n); - - for (octave_idx_type i = 0; i < n; i++) - retval[i] = chm.row_as_string (i); - } + for (octave_idx_type i = 0; i < n; i++) + retval[i] = chm.row_as_string (i); } else error ("invalid conversion of charNDArray to string_vector");