diff --git a/+io/parseGroup.m b/+io/parseGroup.m index 46a87c6c..09c4d4e3 100644 --- a/+io/parseGroup.m +++ b/+io/parseGroup.m @@ -55,12 +55,6 @@ if isempty(Type.typename) parsed = types.untyped.Set(... [attributeProperties; datasetProperties; groupProperties; linkProperties]); - - if isempty(parsed) - %special case where a directory is simply empty. Return itself but - %empty - parsed(root) = []; - end else if groupProperties.Count > 0 %elide group properties diff --git a/+types/+untyped/Set.m b/+types/+untyped/Set.m index 0fb36837..22245144 100644 --- a/+types/+untyped/Set.m +++ b/+types/+untyped/Set.m @@ -71,6 +71,11 @@ cnt = obj.Map.Count; end + % overloads isemty + function tf = isempty(obj) + tf = obj.Count == 0; + end + %overloads size(obj) function varargout = size(obj, dim) if nargin > 1 @@ -80,7 +85,7 @@ varargout{1} = obj.Count; end else - if nargout == 1 + if nargout == 0 || nargout == 1 varargout{1} = [obj.Count, 1]; else varargout = num2cell( ones(1, nargout) );