From f375ebeed674ccf850d6647a3aaa979e4621896d Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 28 Sep 2010 21:02:55 +0000 Subject: Scope a varible inside an if statement, to make it clear that it's not used afterwards. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114986 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/Metadata.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'lib/VMCore/Metadata.cpp') diff --git a/lib/VMCore/Metadata.cpp b/lib/VMCore/Metadata.cpp index da69c43ff7..162884c5f6 100644 --- a/lib/VMCore/Metadata.cpp +++ b/lib/VMCore/Metadata.cpp @@ -343,9 +343,7 @@ void MDNode::replaceOperand(MDNodeOperand *Op, Value *To) { FoldingSetNodeID ID; Profile(ID); void *InsertPoint; - MDNode *N = pImpl->MDNodeSet.FindNodeOrInsertPos(ID, InsertPoint); - - if (N) { + if (MDNode *N = pImpl->MDNodeSet.FindNodeOrInsertPos(ID, InsertPoint)) { N->replaceAllUsesWith(this); N->destroy(); N = pImpl->MDNodeSet.FindNodeOrInsertPos(ID, InsertPoint); -- cgit v1.2.3-18-g5258