[Type checker] Pull the null check into swift::isSIMDOperator().

This commit is contained in:
Doug Gregor
2018-12-11 16:39:10 -08:00
parent 88d34a1c7c
commit 052d4c196c
2 changed files with 5 additions and 5 deletions
+2 -3
View File
@@ -1473,7 +1473,7 @@ static ArrayRef<OverloadChoice> partitionSIMDOperators(
// Check whether we have any SIMD operators.
bool foundSIMDOperator = false;
for (const auto &choice : choices) {
if (choice.isDecl() && isSIMDOperator(choice.getDecl())) {
if (isSIMDOperator(choice.getDecl())) {
foundSIMDOperator = true;
break;
}
@@ -1485,8 +1485,7 @@ static ArrayRef<OverloadChoice> partitionSIMDOperators(
scratch.assign(choices.begin(), choices.end());
std::stable_partition(scratch.begin(), scratch.end(),
[](const OverloadChoice &choice) {
return !choice.isDecl() ||
!isSIMDOperator(choice.getDecl());
return !isSIMDOperator(choice.getDecl());
});
return scratch;