Mercurial > hg > octave-lojdl
diff src/ov-str-mat.cc @ 6816:ec4c1dfb985a
[project @ 2007-08-15 04:45:39 by jwe]
author | jwe |
---|---|
date | Wed, 15 Aug 2007 04:45:39 +0000 (2007-08-15) |
parents | fa3c21cdf3bc |
children | 9e32bb109980 |
line wrap: on
line diff
--- 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");