Skip to content

Commit 3d919e1

Browse files
committed
Inline check for existential type and use isa
1 parent 75c1fad commit 3d919e1

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

lib/Sema/PerformanceHints.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,9 @@ void checkImplicitCopyReturnType(const ClosureExpr *Closure,
6767
}
6868
}
6969

70-
bool isExistentialType(Type T) {
71-
return dyn_cast<ExistentialType>(T) != nullptr;
72-
}
73-
74-
bool hasExistentialAnyInType(Type type) {
75-
return type->getCanonicalType().findIf(isExistentialType);
70+
bool hasExistentialAnyInType(Type T) {
71+
return T->getCanonicalType().findIf(
72+
[](CanType CT) { return isa<ExistentialType>(CT); });
7673
}
7774

7875
void checkExistentialInFunctionReturnType(const FuncDecl *FD,

0 commit comments

Comments
 (0)