Skip to content

Commit 1d8962f

Browse files
committed
[NFC] Simplify an instance of DeclRefTypeRepr construction
1 parent 70a1f9f commit 1d8962f

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

lib/Sema/TypeCheckRuntimeMetadataAttr.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,7 @@ static TypeRepr *buildTypeRepr(DeclContext *typeContext,
7878
// Reverse the components to form a valid outer-to-inner name sequence.
7979
std::reverse(components.begin(), components.end());
8080

81-
TypeRepr *typeRepr = nullptr;
82-
if (components.size() == 1) {
83-
typeRepr = components.front();
84-
} else {
85-
typeRepr = MemberTypeRepr::create(ctx, components);
86-
}
81+
TypeRepr *typeRepr = MemberTypeRepr::create(ctx, components);
8782

8883
if (forMetatype)
8984
return new (ctx) MetatypeTypeRepr(typeRepr, /*MetaLoc=*/SourceLoc());

0 commit comments

Comments
 (0)