Better way to free NestedNameSpecifiers. Thanks, Chris

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67880 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index 7667157..2fc6a7d 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -78,22 +78,12 @@
   }
 
   // Destroy nested-name-specifiers.
-  llvm::SmallVector<NestedNameSpecifier *, 16> NestedNameSpecs; 
-  {
-    for (llvm::FoldingSet<NestedNameSpecifier>::iterator
-           NNS = NestedNameSpecifiers.begin(),
-           NNSEnd = NestedNameSpecifiers.end(); 
-         NNS != NNSEnd; 
-         ++NNS)
-      NestedNameSpecs.push_back(&*NNS);
-  }
-  NestedNameSpecifiers.clear();
-  for (llvm::SmallVector<NestedNameSpecifier *, 16>::iterator
-         NNS = NestedNameSpecs.begin(),
-         NNSEnd = NestedNameSpecs.end(); 
+  for (llvm::FoldingSet<NestedNameSpecifier>::iterator
+         NNS = NestedNameSpecifiers.begin(),
+         NNSEnd = NestedNameSpecifiers.end(); 
        NNS != NNSEnd; 
-       ++NNS)
-    (*NNS)->Destroy(*this);
+       /* Increment in loop */)
+    (*NNS++).Destroy(*this);
 
   if (GlobalNestedNameSpecifier)
     GlobalNestedNameSpecifier->Destroy(*this);