Mercurial > hg > octave-lojdl
changeset 7571:c01ff6818f4c
simplify struct array printing
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 07 Mar 2008 10:04:37 -0500 |
parents | 8bf1bcb0ad8f |
children | 85da2ab0c6fd |
files | src/ChangeLog src/ov-struct.cc |
diffstat | 2 files changed, 9 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2008-03-07 John W. Eaton <jwe@octave.org> + + * ov-struct.cc (octave_struct::print_raw): Don't print contents fo + struct arrays that have more than one element. + 2008-03-06 David Bateman <dbateman@free.fr> * DLD-FUNCTIONS/matrix_type.cc (Fmatrix_type): Document that
--- a/src/ov-struct.cc +++ b/src/ov-struct.cc @@ -499,10 +499,7 @@ if (Vstruct_levels_to_print >= 0) { - bool print_keys_only = (Vstruct_levels_to_print == 0 - || map.numel () == 0); - - Vstruct_levels_to_print--; + bool print_keys_only = Vstruct_levels_to_print-- == 0; indent (os); os << "{"; @@ -512,7 +509,7 @@ octave_idx_type n = map.numel (); - if (n == 0 || (n > 1 && print_keys_only)) + if (n != 1 || print_keys_only) { indent (os); dim_vector dv = dims (); @@ -533,7 +530,7 @@ octave_value tmp = (n == 1) ? val(0) : octave_value (val, true); - if (print_keys_only) + if (n != 1 || print_keys_only) { indent (os); os << key; @@ -548,7 +545,7 @@ tmp.print_with_name (os, key); } - if (n == 0 || (n > 1 && print_keys_only)) + if (n != 1 || print_keys_only) decrement_indent_level (); decrement_indent_level ();