diff libinterp/corefcn/inv.cc @ 20898:8da80da1ac37

maint: Use ovl() more places in the code.
author Rik <rik@octave.org>
date Mon, 14 Dec 2015 17:53:27 -0800
parents c07bee629973
children 48b2ad5ee801
line wrap: on
line diff
--- a/libinterp/corefcn/inv.cc	Mon Dec 14 15:34:39 2015 -0800
+++ b/libinterp/corefcn/inv.cc	Mon Dec 14 17:53:27 2015 -0800
@@ -61,8 +61,6 @@
   if (args.length () != 1)
     print_usage ();
 
-  octave_value_list retval;
-
   octave_value arg = args(0);
 
   octave_idx_type nr = arg.rows ();
@@ -71,14 +69,14 @@
   int arg_is_empty = empty_arg ("inverse", nr, nc);
 
   if (arg_is_empty < 0)
-    return retval;
+    return octave_value_list ();
   else if (arg_is_empty > 0)
     return octave_value (Matrix ());
 
   if (nr != nc)
     {
       gripe_square_matrix_required ("inverse");
-      return retval;
+      return octave_value_list ();
     }
 
   octave_value result;
@@ -191,11 +189,12 @@
         gripe_wrong_type_arg ("inv", arg);
     }
 
+  octave_value_list retval (nargout > 1 ? 2 : 1);
+
+  retval(0) = result;
   if (nargout > 1)
     retval(1) = isfloat ? octave_value (frcond) : octave_value (rcond);
 
-  retval(0) = result;
-
   bool rcond_plus_one_eq_one = false;
 
   if (isfloat)