Skip to content

Commit a5d8e21

Browse files
committed
clean up else after return
1 parent 941df8d commit a5d8e21

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ bool handleConstMemberCall(const CallExpr *CE,
581581

582582
State.Env.setStorageLocation(*CE, Loc);
583583
return true;
584-
} else {
584+
}
585585
// PRValue cases:
586586
if (CE->getType()->isBooleanType() || CE->getType()->isPointerType()) {
587587
// If the const method returns a boolean or pointer type.
@@ -591,7 +591,8 @@ bool handleConstMemberCall(const CallExpr *CE,
591591
return false;
592592
State.Env.setValue(*CE, *Val);
593593
return true;
594-
} else if (isSupportedOptionalType(CE->getType())) {
594+
}
595+
if (isSupportedOptionalType(CE->getType())) {
595596
// If the const method returns an optional by value.
596597
const FunctionDecl *DirectCallee = CE->getDirectCallee();
597598
if (DirectCallee == nullptr)
@@ -608,7 +609,7 @@ bool handleConstMemberCall(const CallExpr *CE,
608609
copyRecord(cast<RecordStorageLocation>(Loc), ResultLoc, State.Env);
609610
return true;
610611
}
611-
}
612+
612613

613614
return false;
614615
}

0 commit comments

Comments
 (0)