Use clang-tidy to simplify boolean conditional return statements
Details
Details
Diff Detail
Diff Detail
Event Timeline
lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp | ||
---|---|---|
692–693 | I'd leave alone code that is structured like a chain of conditions with a default in the end: if (X) return true; if (Y) return true; ... if (Z) return true; return false; It's arguable whether changing the last if + return to return Z; makes the code more readable, so I'd just keep them as is. |
lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp | ||
---|---|---|
692–693 | In this case it isn't a simple if-return, if-return, if-return. |
lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp | ||
---|---|---|
692–693 | I agree that we should keep these as is for better readability and maintainability. | |
lib/StaticAnalyzer/Core/SValBuilder.cpp | ||
397 | Same chaining pattern here. I do not think it should change. | |
lib/StaticAnalyzer/Core/SymbolManager.cpp | ||
496 | I am OK with changing this one. |
I'd leave alone code that is structured like a chain of conditions with a default in the end:
It's arguable whether changing the last if + return to return Z; makes the code more readable, so I'd just keep them as is.