Mercurial > octave
diff libinterp/octave-value/ov-builtin.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 | 48b2ad5ee801 |
children | e39e05d90788 |
line wrap: on
line diff
--- a/libinterp/octave-value/ov-builtin.cc Tue Jan 12 21:45:58 2016 +0100 +++ b/libinterp/octave-value/ov-builtin.cc Wed Jan 13 11:02:22 2016 -0800 @@ -107,37 +107,35 @@ if (args.has_magic_colon ()) error ("invalid use of colon in function argument list"); - else - { - unwind_protect frame; + + unwind_protect frame; - octave_call_stack::push (this); + octave_call_stack::push (this); - frame.add_fcn (octave_call_stack::pop); + frame.add_fcn (octave_call_stack::pop); - if (lvalue_list || curr_lvalue_list) - { - frame.protect_var (curr_lvalue_list); - curr_lvalue_list = lvalue_list; - } + if (lvalue_list || curr_lvalue_list) + { + frame.protect_var (curr_lvalue_list); + curr_lvalue_list = lvalue_list; + } - BEGIN_PROFILER_BLOCK (octave_builtin) + BEGIN_PROFILER_BLOCK (octave_builtin) - retval = (*f) (args, nargout); - // Do not allow null values to be returned from functions. - // FIXME: perhaps true builtins should be allowed? - retval.make_storable_values (); - // Fix the case of a single undefined value. - // This happens when a compiled function uses - // octave_value retval; - // instead of - // octave_value_list retval; - // the idiom is very common, so we solve that here. - if (retval.length () == 1 && retval.xelem (0).is_undefined ()) - retval.clear (); + retval = (*f) (args, nargout); + // Do not allow null values to be returned from functions. + // FIXME: perhaps true builtins should be allowed? + retval.make_storable_values (); + // Fix the case of a single undefined value. + // This happens when a compiled function uses + // octave_value retval; + // instead of + // octave_value_list retval; + // the idiom is very common, so we solve that here. + if (retval.length () == 1 && retval.xelem (0).is_undefined ()) + retval.clear (); - END_PROFILER_BLOCK - } + END_PROFILER_BLOCK return retval; }