Skip to content

Commit 9312899

Browse files
committed
[CS] NFC: Remove an unused return value
`isBuildableIfChainRecursive` never returned anything other than `true`, change it to just be a void call.
1 parent 1e012fe commit 9312899

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

lib/Sema/BuilderTransform.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -780,16 +780,17 @@ class ResultBuilderTransform
780780
#undef UNSUPPORTED_STMT
781781

782782
private:
783-
static bool isBuildableIfChainRecursive(IfStmt *ifStmt, unsigned &numPayloads,
784-
bool &isOptional) {
783+
static void checkBuildableIfChainRecursive(IfStmt *ifStmt,
784+
unsigned &numPayloads,
785+
bool &isOptional) {
785786
// The 'then' clause contributes a payload.
786787
++numPayloads;
787788

788789
// If there's an 'else' clause, it contributes payloads:
789790
if (auto elseStmt = ifStmt->getElseStmt()) {
790791
// If it's 'else if', it contributes payloads recursively.
791792
if (auto elseIfStmt = dyn_cast<IfStmt>(elseStmt)) {
792-
return isBuildableIfChainRecursive(elseIfStmt, numPayloads, isOptional);
793+
checkBuildableIfChainRecursive(elseIfStmt, numPayloads, isOptional);
793794
// Otherwise it's just the one.
794795
} else {
795796
++numPayloads;
@@ -799,8 +800,6 @@ class ResultBuilderTransform
799800
} else {
800801
isOptional = true;
801802
}
802-
803-
return true;
804803
}
805804

806805
static bool hasUnconditionalElse(IfStmt *ifStmt) {
@@ -815,8 +814,7 @@ class ResultBuilderTransform
815814

816815
bool isBuildableIfChain(IfStmt *ifStmt, unsigned &numPayloads,
817816
bool &isOptional) {
818-
if (!isBuildableIfChainRecursive(ifStmt, numPayloads, isOptional))
819-
return false;
817+
checkBuildableIfChainRecursive(ifStmt, numPayloads, isOptional);
820818

821819
// If there's a missing 'else', we need 'buildOptional' to exist.
822820
if (isOptional && !builder.supportsOptional())

0 commit comments

Comments
 (0)