diff libinterp/corefcn/sub2ind.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 850e3d2533d4
children e39e05d90788
line wrap: on
line diff
--- a/libinterp/corefcn/sub2ind.cc	Tue Jan 12 21:45:58 2016 +0100
+++ b/libinterp/corefcn/sub2ind.cc	Wed Jan 13 11:02:22 2016 -0800
@@ -43,18 +43,16 @@
 
   if (n < 1)
     error ("%s: dimension vector DIMS must not be empty", name);
-  else
+
+  dv.resize (std::max (n, static_cast<octave_idx_type> (2)));
+  dv(1) = 1;
+  for (octave_idx_type i = 0; i < n; i++)
     {
-      dv.resize (std::max (n, static_cast<octave_idx_type> (2)));
-      dv(1) = 1;
-      for (octave_idx_type i = 0; i < n; i++)
-        {
-          octave_idx_type ii = dimsv(i);
-          if (ii == dimsv(i) && ii >= 0)
-            dv(i) = ii;
-          else
-            error ("%s: dimension vector DIMS must contain integers", name);
-        }
+      octave_idx_type ii = dimsv(i);
+      if (ii == dimsv(i) && ii >= 0)
+        dv(i) = ii;
+      else
+        error ("%s: dimension vector DIMS must contain integers", name);
     }
 
   return dv;