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
No related branches found
No related tags found
No related merge requests found
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');
\ No newline at end of file
% NB: restricting the search to builtins is important for speed (otherwise it
% 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.
Finish editing this message first!
Please register or to comment