Mercurial > hg > octave-terminal
changeset 12143:ed129a03f93c
octave_scalar_struct::print_raw: avoid unnecessary conversion of map contents to Cell
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sun, 23 Jan 2011 22:31:29 -0500 |
parents | accccf832528 |
children | 605ed5bbb643 |
files | src/ChangeLog src/ov-struct.cc |
diffstat | 2 files changed, 9 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-01-23 John W. Eaton <jwe@octave.org> + + * ov-struct.cc (octave_scalar_struct::print_raw): + Avoid unnecessary conversion of map value to Cell. + 2011-01-22 John W. Eaton <jwe@octave.org> * symtab.h (symbol_table::parent_classes):
--- a/src/ov-struct.cc +++ b/src/ov-struct.cc @@ -1337,20 +1337,18 @@ { std::string key = key_list[i]; - Cell val = map.contents (key); - - octave_value tmp = val(0); + octave_value val = map.contents (key); if (print_fieldnames_only) { indent (os); os << key; - dim_vector dv = tmp.dims (); - os << ": " << dv.str () << " " << tmp.type_name (); + dim_vector dv = val.dims (); + os << ": " << dv.str () << " " << val.type_name (); newline (os); } else - tmp.print_with_name (os, key); + val.print_with_name (os, key); } decrement_indent_level ();