Mercurial > octave
changeset 28197:087bccd1ab49 stable
new function to identify anonymous function handles
* ov-fcn-handle.h (octave_fcn_handle::is_anonymous): New function.
* ov-usr-fcn.cc (Fnargout): Use it instead of checking whether
function handle name is "anonymous".
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 19 Mar 2020 13:54:03 -0400 |
parents | 7567413e7246 |
children | 52b2680e091c |
files | libinterp/octave-value/ov-fcn-handle.h libinterp/octave-value/ov-usr-fcn.cc |
diffstat | 2 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/octave-value/ov-fcn-handle.h Wed Apr 08 15:59:56 2020 -0400 +++ b/libinterp/octave-value/ov-fcn-handle.h Thu Mar 19 13:54:03 2020 -0400 @@ -97,6 +97,8 @@ bool is_function_handle (void) const { return true; } + bool is_anonymous (void) const { return m_name == anonymous; } + bool is_nested (void) const { return m_is_nested; } dim_vector dims (void) const;
--- a/libinterp/octave-value/ov-usr-fcn.cc Wed Apr 08 15:59:56 2020 -0400 +++ b/libinterp/octave-value/ov-usr-fcn.cc Thu Mar 19 13:54:03 2020 -0400 @@ -792,9 +792,8 @@ if (func.is_function_handle ()) { octave_fcn_handle *fh = func.fcn_handle_value (); - std::string fh_nm = fh->fcn_name (); - if (fh_nm == octave_fcn_handle::anonymous) + if (fh->is_anonymous ()) return ovl (-1); }