Skip to content

Commit

Permalink
simplify method
Browse files Browse the repository at this point in the history
  • Loading branch information
mmews committed Aug 9, 2024
1 parent 6e91873 commit add4be0
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions plugins/org.eclipse.n4js.ts.model/model/TypeRefs.xcore
Original file line number Diff line number Diff line change
Expand Up @@ -820,8 +820,13 @@ abstract class StructuralTypeRef {
* (if non-empty) or the genStructuralMembers.
*/
op TStructMember[] getStructuralMembers() {
return (if (structuralType !== null) structuralType.ownedMembers else if (!astStructuralMembers.empty) astStructuralMembers else genStructuralMembers).
unmodifiableView;
if (structuralType !== null) {
return structuralType.ownedMembers.unmodifiableView;
}
if (!astStructuralMembers.empty) {
return astStructuralMembers.unmodifiableView;
}
return genStructuralMembers.unmodifiableView;
}
op TStructMember[] getStructuralMembersWithCallConstructSignatures() {
val structType = getStructuralType();
Expand Down Expand Up @@ -881,8 +886,13 @@ class ParameterizedTypeRefStructural extends ParameterizedTypeRef, StructuralTyp
* (if non-empty) or the genStructuralMembers.
*/
op TStructMember[] getStructuralMembers() {
return (if (structuralType !== null) structuralType.ownedMembers else if (!astStructuralMembers.empty) astStructuralMembers else genStructuralMembers).
unmodifiableView;
if (structuralType !== null) {
return structuralType.ownedMembers.unmodifiableView;
}
if (!astStructuralMembers.empty) {
return astStructuralMembers.unmodifiableView;
}
return genStructuralMembers.unmodifiableView;
}
/*
* Overrides {@link TypeRef#internalGetTypeRefAsString(boolean)}
Expand Down

0 comments on commit add4be0

Please sign in to comment.