Skip to content
Snippets Groups Projects
Verified Commit ee200a03 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

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.
parent 1cb30856
Branches
Tags
No related merge requests found
Pipeline #7621 passed
function A = isoctave() function A = isoctave()
% Copyright © 2013-2016 Dynare Team % Copyright © 2013-2022 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -17,4 +17,6 @@ function A = isoctave() ...@@ -17,4 +17,6 @@ function A = isoctave()
% You should have received a copy of the GNU General Public License % You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <https://www.gnu.org/licenses/>. % 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
\ No newline at end of file % will lookup files, which is slow)
A = exist('OCTAVE_VERSION', 'builtin');
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment