r300703 - Remove unnecessary condition as suggested by clang-tidy. NFC

Gabor Horvath via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 19 08:11:11 PDT 2017


Author: xazax
Date: Wed Apr 19 10:11:10 2017
New Revision: 300703

URL: http://llvm.org/viewvc/llvm-project?rev=300703&view=rev
Log:
Remove unnecessary condition as suggested by clang-tidy. NFC

Patch by: Gergely Angeli!

Differential Revision: https://reviews.llvm.org/D31938

Modified:
    cfe/trunk/lib/AST/ASTContext.cpp

Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=300703&r1=300702&r2=300703&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Wed Apr 19 10:11:10 2017
@@ -9414,10 +9414,8 @@ createDynTypedNode(const NestedNameSpeci
           if (!NodeOrVector.template is<ASTContext::ParentVector *>()) {
             auto *Vector = new ASTContext::ParentVector(
                 1, getSingleDynTypedNodeFromParentMap(NodeOrVector));
-            if (auto *Node =
-                    NodeOrVector
-                        .template dyn_cast<ast_type_traits::DynTypedNode *>())
-              delete Node;
+            delete NodeOrVector
+                    .template dyn_cast<ast_type_traits::DynTypedNode *>();
             NodeOrVector = Vector;
           }
 




More information about the cfe-commits mailing list