diff src/utils.cc @ 11066:e678346a47d9

toplev.cc, sighandlers.cc, utils.cc, octave.cc, pt-eval.cc pt-idx.cc: Octave_map to octave_map and octave_scalar_map conversion
author John W. Eaton <jwe@octave.org>
date Thu, 30 Sep 2010 06:00:00 -0400
parents 30b9b0a507f1
children 0d9640d755b1
line wrap: on
line diff
--- a/src/utils.cc	Thu Sep 30 05:30:28 2010 -0400
+++ b/src/utils.cc	Thu Sep 30 06:00:00 2010 -0400
@@ -1036,17 +1036,19 @@
                    std::string& type_string,
                    std::list<octave_value_list>& idx)
 {
-  Octave_map m = arg.map_value ();
+  const octave_map m = arg.map_value ();
 
   if (! error_state
       && m.nfields () == 2 && m.contains ("type") && m.contains ("subs"))
     {
-      Cell& type = m.contents ("type");
-      Cell& subs = m.contents ("subs");
+      const Cell type = m.contents ("type");
+      const Cell subs = m.contents ("subs");
 
-      type_string = std::string (type.length(), '\0');
+      octave_idx_type nel = type.numel ();
 
-      for (int k = 0; k < type.length (); k++)
+      type_string = std::string (nel, '\0');
+
+      for (int k = 0; k < nel; k++)
         {
           std::string item = type(k).string_value ();