From 100f4d5130050de227a4c397edacc7029153ec5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= Date: Tue, 8 Oct 2019 16:11:58 +0200 Subject: [PATCH] Simplify octave_ver_less_than using builtin compare_versions() --- matlab/octave_ver_less_than.m | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/matlab/octave_ver_less_than.m b/matlab/octave_ver_less_than.m index 3c1a6a6a0..0f4fc1fa2 100644 --- a/matlab/octave_ver_less_than.m +++ b/matlab/octave_ver_less_than.m @@ -15,7 +15,7 @@ function r = octave_ver_less_than(verstr) % SPECIAL REQUIREMENTS % none -% Copyright (C) 2008-2017 Dynare Team +% Copyright (C) 2008-2019 Dynare Team % % This file is part of Dynare. % @@ -32,15 +32,6 @@ function r = octave_ver_less_than(verstr) % You should have received a copy of the GNU General Public License % along with Dynare. If not, see . -cur_verstr = version(); +r = compare_versions(version(), verstr, "<"); -r = get_ver_numeric(cur_verstr) < get_ver_numeric(verstr); endfunction - -function x = get_ver_numeric(verstr) -nums = sscanf(verstr, '%d.%d.%d')'; -if length(nums) < 3 - nums(3) = 0; -end -x = nums * [1; 0.01; 0.0001 ]; -endfunction \ No newline at end of file