Skip to content

Commit

Permalink
Vastly simplify ver checks
Browse files Browse the repository at this point in the history
- Also fixes tests.
  • Loading branch information
lawrence-mbf committed May 26, 2023
1 parent ef248f5 commit af0db0a
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions +io/parseDataset.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@

switch datatype.Class
case 'H5T_STRING'
versionNumber = getMatlabVersionNumber();
assert(~isnan(versionNumber));
if versionNumber < 9.8
if verLessThan('MATLAB', '9.8')
% MATLAB 2020a fixed string support for HDF5, making
% reading strings "consistent" with regular use.
data = data .';
Expand Down Expand Up @@ -84,9 +82,4 @@
end
H5D.close(did);
H5F.close(fid);
end

function versionNumber = getMatlabVersionNumber()
VersionInfo = ver('MATLAB');
versionNumber = str2double(VersionInfo.Version);
end

0 comments on commit af0db0a

Please sign in to comment.