diff src/ov-struct.cc @ 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 12df7854fa7c
children 88ff30dcc048
line wrap: on
line diff
--- a/src/ov-struct.cc	Sun Jan 23 07:26:55 2011 -0800
+++ b/src/ov-struct.cc	Sun Jan 23 22:31:29 2011 -0500
@@ -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 ();