From ad98885be175b537c839b88785bb463e90c3873e Mon Sep 17 00:00:00 2001 From: Alexander Kornienko Date: Fri, 6 Nov 2015 01:26:37 +0000 Subject: Refactor: Simplify boolean conditional return statements in lib/ARCMigrate Patch by Richard Thomson! (+a couple of modifications to address comments) Differential revision: http://reviews.llvm.org/D10009 llvm-svn: 252261 --- clang/lib/ARCMigrate/TransEmptyStatementsAndDealloc.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'clang/lib/ARCMigrate/TransEmptyStatementsAndDealloc.cpp') diff --git a/clang/lib/ARCMigrate/TransEmptyStatementsAndDealloc.cpp b/clang/lib/ARCMigrate/TransEmptyStatementsAndDealloc.cpp index 9689f40760c..d45d5d60b78 100644 --- a/clang/lib/ARCMigrate/TransEmptyStatementsAndDealloc.cpp +++ b/clang/lib/ARCMigrate/TransEmptyStatementsAndDealloc.cpp @@ -104,9 +104,7 @@ public: return false; if (!S->getThen() || !Visit(S->getThen())) return false; - if (S->getElse() && !Visit(S->getElse())) - return false; - return true; + return !S->getElse() || Visit(S->getElse()); } bool VisitWhileStmt(WhileStmt *S) { if (S->getConditionVariable()) -- cgit v1.2.3