Mercurial > octave
view scripts/legacy/@inline/feval.m @ 30912:ec5b57af230a
Improve performance of inline functions.
* NEWS.8.md: Announce compatibility and performance improvements.
* scripts/legacy/@inline/inline.m: Add new field "fh" to inline
class which holds an anonymous function handle implementing the
inline function. Rename member variable "numArgs" to "nargs"
to get away from CamelCase.
* scripts/legacy/@inline/feval.m: Re-use existing class member
variable "fh" to execute function rather than creating it every
time feval() is called.
* scripts/legacy/@inline/nargin.m: Update to use class member
variable "nargs" rather than "numArgs".
author | Rik <rik@octave.org> |
---|---|
date | Wed, 06 Apr 2022 21:47:52 -0700 |
parents | b7edac56a810 |
children | 505ed551e366 |
line wrap: on
line source
######################################################################## ## ## Copyright (C) 2020-2022 The Octave Project Developers ## ## See the file COPYRIGHT.md in the top-level directory of this ## distribution or <https://octave.org/copyright/>. ## ## This file is part of Octave. ## ## Octave is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## Octave is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with Octave; see the file COPYING. If not, see ## <https://www.gnu.org/licenses/>. ## ######################################################################## function retval = feval (fobj, varargin) retval = fobj.fh (varargin{:}); endfunction