diff libinterp/corefcn/variables.cc @ 21055:5e00ed38a58b

maint: Replace if/error/else paradigm with just if/error. * __ilu__.cc, data.cc, file-io.cc, graphics.cc, graphics.in.h, ls-mat5.cc, lu.cc, octave-link.cc, regexp.cc, schur.cc, spparms.cc, sub2ind.cc, syscalls.cc, toplev.cc, variables.cc, xpow.cc, audiodevinfo.cc, ccolamd.cc, ov-builtin.cc, ov-classdef.cc, ov-intx.h, ov-lazy-idx.cc, ov-mex-fcn.cc, op-int.h, lex.ll, oct-parse.in.yy, pt-binop.cc, pt-cbinop.cc, pt-const.cc, pt-decl.h, pt-fcn-handle.cc, pt-unop.cc, CollocWt.cc: Replace if/error/else paradigm with just if/error.
author Rik <rik@octave.org>
date Wed, 13 Jan 2016 11:02:22 -0800
parents 93748bcaec17
children d6fa72047aeb
line wrap: on
line diff
--- a/libinterp/corefcn/variables.cc	Tue Jan 12 21:45:58 2016 +0100
+++ b/libinterp/corefcn/variables.cc	Wed Jan 13 11:02:22 2016 -0800
@@ -844,8 +844,7 @@
       if (ival < minval)
         error ("%s: arg must be greater than %d", nm, minval);
       else if (ival > maxval)
-        error ("%s: arg must be less than or equal to %d",
-               nm, maxval);
+        error ("%s: arg must be less than or equal to %d", nm, maxval);
       else
         var = ival;
     }
@@ -1611,31 +1610,29 @@
           // stored at all.
           if (i == argc - 1)
             error ("whos: -file argument must be followed by a filename");
-          else
-            {
-              std::string nm = argv[i + 1];
-
-              unwind_protect frame;
-
-              // Set up temporary scope.
-
-              symbol_table::scope_id tmp_scope = symbol_table::alloc_scope ();
-              frame.add_fcn (symbol_table::erase_scope, tmp_scope);
-
-              symbol_table::set_scope (tmp_scope);
-
-              octave_call_stack::push (tmp_scope, 0);
-              frame.add_fcn (octave_call_stack::pop);
-
-              frame.add_fcn (symbol_table::clear_variables);
-
-              feval ("load", octave_value (nm), 0);
-
-              std::string newmsg = std::string ("Variables in the file ")
-                + nm + ":\n\n";
-
-              retval =  do_who (i, argv, return_list, verbose, newmsg);
-            }
+
+          std::string nm = argv[i + 1];
+
+          unwind_protect frame;
+
+          // Set up temporary scope.
+
+          symbol_table::scope_id tmp_scope = symbol_table::alloc_scope ();
+          frame.add_fcn (symbol_table::erase_scope, tmp_scope);
+
+          symbol_table::set_scope (tmp_scope);
+
+          octave_call_stack::push (tmp_scope, 0);
+          frame.add_fcn (octave_call_stack::pop);
+
+          frame.add_fcn (symbol_table::clear_variables);
+
+          feval ("load", octave_value (nm), 0);
+
+          std::string newmsg = std::string ("Variables in the file ")
+            + nm + ":\n\n";
+
+          retval =  do_who (i, argv, return_list, verbose, newmsg);
 
           return retval;
         }