Mercurial > octave-libgccjit
diff src/ov-struct.cc @ 7571:c01ff6818f4c
simplify struct array printing
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 07 Mar 2008 10:04:37 -0500 |
parents | cb8d75cedc93 |
children | c195bd0a5c64 |
line wrap: on
line diff
--- a/src/ov-struct.cc Fri Mar 07 06:24:10 2008 -0500 +++ b/src/ov-struct.cc Fri Mar 07 10:04:37 2008 -0500 @@ -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 ();