Skip to content

Commit 0d4dbe7

Browse files
committed
Update getSchemaName.m
Remove concatenation of structs. Structs might have different fields, and the concatenation would fail. Only need name and potentially label, so explicitly get these instead of relying on struct concatenation
1 parent 048b729 commit 0d4dbe7

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

code/internal/+openminds/+internal/+vocab/getSchemaName.m

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,12 @@
2424
end
2525

2626
C = struct2cell(typesVocab);
27-
S = [C{:}];
28-
29-
allNames = {S.name};
3027

28+
allNames = cellfun(@(c) string(c.name), C);
3129
isMatch = strcmpi(allNames, nameAlias);
3230

3331
if ~any(isMatch)
34-
allLabels = {S.label};
32+
allLabels = cellfun(@(c) string(c.label), C);
3533
isMatch = strcmpi(allLabels, nameAlias);
3634
end
3735

0 commit comments

Comments
 (0)