changeset 8161:64f1cd525656

symtab.cc: style fixes
author John W. Eaton <jwe@octave.org>
date Mon, 29 Sep 2008 18:08:53 -0400
parents 436438954797
children 293c4b5fe33d
files src/symtab.cc
diffstat 1 files changed, 12 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/symtab.cc	Mon Sep 29 16:48:04 2008 -0400
+++ b/src/symtab.cc	Mon Sep 29 18:08:53 2008 -0400
@@ -941,13 +941,14 @@
 {
   octave_value retval;
 
-  if (name.at(0) == '@')
+  if (! name.empty () && name[0] == '@')
     {
-      // Looking for a class specific function
+      // Look for a class specific function.
       std::string dispatch_type = 
-	name.substr(1, name.find_first_of(file_ops::dir_sep_str ()) - 1);
+	name.substr (1, name.find_first_of (file_ops::dir_sep_str ()) - 1);
+
       std::string method = 
-	name.substr (name.find_last_of(file_ops::dir_sep_str ()) + 1, 
+	name.substr (name.find_last_of (file_ops::dir_sep_str ()) + 1, 
 		     std::string::npos);
 
       retval = find_method (method, dispatch_type);
@@ -957,26 +958,30 @@
       size_t pos = name.find_first_of (Vfilemarker);
 
       if (pos == std::string::npos)
-	retval = 
-	  find (name, args, arg_names, evaluated_args, args_evaluated, true);
+	retval = find (name, args, arg_names, evaluated_args,
+		       args_evaluated, true);
       else
 	{
-	  std::string fcn_scope = name.substr(0, pos);
+	  std::string fcn_scope = name.substr (0, pos);
 	  scope_id stored_scope = xcurrent_scope;
 	  xcurrent_scope = xtop_scope;
 	  octave_value parent = find_function (name.substr(0, pos));
+
 	  if (parent.is_defined ())
 	    {
 	      octave_function *parent_fcn = parent.function_value ();
+
 	      if (parent_fcn)
 		{
 		  xcurrent_scope = parent_fcn->scope ();
+
 		  if (xcurrent_scope > 1)
 		    retval = find_function (name.substr (pos + 1), args,
 					    arg_names, evaluated_args, 
 					    args_evaluated);
 		}
 	    }
+
 	  xcurrent_scope = stored_scope;
 	}
     }
@@ -1012,7 +1017,6 @@
 	      os << "\n";
 	    }
 
-
 	  inst->do_dump (os);
 	}
     }