isoctave: performance improvement

Explicitly specify that OCTAVE_VERSION is a builtin. Otherwise the call to
“exists” will look for a file, among other things, which takes a lot of time.
unit-tests
Sébastien Villemot 2022-11-02 17:25:26 +01:00
parent 1cb3085667
commit ee200a03b8
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
1 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,6 @@
function A = isoctave()
% Copyright © 2013-2016 Dynare Team
% Copyright © 2013-2022 Dynare Team
%
% This file is part of Dynare.
%
@ -17,4 +17,6 @@ function A = isoctave()
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <https://www.gnu.org/licenses/>.
A = exist('OCTAVE_VERSION');
% NB: restricting the search to builtins is important for speed (otherwise it
% will lookup files, which is slow)
A = exist('OCTAVE_VERSION', 'builtin');