================
@@ -710,29 +706,28 @@ void NullabilityChecker::checkPreStmt(const ReturnStmt *S,
Nullability RetExprTypeLevelNullability =
getNullabilityAnnotation(lookThroughImplicitCasts(RetExpr)->getType());
- bool NullReturnedFromNonNull = (RequiredNullability == Nullability::Nonnull
&&
----------------
NagyDonat wrote:
I refactored this code block because the name of this local boolean
`NullReturnedFromNonNull` was too similar to the checker frontend
`NullReturnedFromNonnull` (which I introduced).
I eliminated the boolean instead of renaming it, because I feel that the old
```c++
bool B = some condition
if (B && other conditions) {
...
}
if (B) {
...
}
```
was less readable than the structure
```c++
if (some conditions) {
if (other conditions) {
...
}
...
}
```
that I'm introducing. (Deeply nested blocks are not ideal, but breaking up a
logically coherent block into multiple `if` statements is even worse.)
https://github.com/llvm/llvm-project/pull/143735
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits