Mercurial > hg > octave-nkf
diff liboctave/Array.cc @ 4828:e78bc84ac0d3
[project @ 2004-03-09 22:36:55 by jwe]
author | jwe |
---|---|
date | Tue, 09 Mar 2004 22:36:55 +0000 |
parents | bb82599f039f |
children | f9262b65c7d9 |
line wrap: on
line diff
--- a/liboctave/Array.cc +++ b/liboctave/Array.cc @@ -1987,10 +1987,12 @@ { Array<T> tmp = Array<T>::index1 (idx_arg, resize_ok); - if (tmp.length () != 0) + int len = tmp.length (); + + if (len == 0 && idx_arg.one_zero_only ()) + retval = Array<T> (tmp, dim_vector (0, 0)); + else retval = Array<T> (tmp, dim_vector (idx_orig_rows, idx_orig_columns)); - else - retval = Array<T> (tmp, dim_vector (0, 0)); } else if (nr == 1 || nc == 1) { @@ -1998,7 +2000,7 @@ // shape as the index. Otherwise, it has same orientation as // indexed object. - Array<T> tmp = index1 (idx_arg, resize_ok); + Array<T> tmp = Array<T>::index1 (idx_arg, resize_ok); int len = tmp.length ();