[cfe-commits] r49582 - /cfe/trunk/lib/Sema/IdentifierResolver.cpp

Argiris Kirtzidis akyrtzi at gmail.com
Sat Apr 12 05:39:00 PDT 2008


Author: akirtzidis
Date: Sat Apr 12 07:38:58 2008
New Revision: 49582

URL: http://llvm.org/viewvc/llvm-project?rev=49582&view=rev
Log:
Use std::list's push_back instead of resize to add an element.

Modified:
    cfe/trunk/lib/Sema/IdentifierResolver.cpp

Modified: cfe/trunk/lib/Sema/IdentifierResolver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/IdentifierResolver.cpp?rev=49582&r1=49581&r2=49582&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/IdentifierResolver.cpp (original)
+++ cfe/trunk/lib/Sema/IdentifierResolver.cpp Sat Apr 12 07:38:58 2008
@@ -190,7 +190,7 @@
 /// The decl must already be part of the decl chain.
 void IdDeclInfo::RemoveShadowed(NamedDecl *D) {
   assert(D && "null decl passed");
-  assert(ShadowedDecls.size() > 0 &&
+  assert(!ShadowedDecls.empty() &&
          "Didn't find this decl on its identifier's chain!");
 
   // common case
@@ -223,7 +223,7 @@
 
   if (CurIndex == VECTOR_SIZE) {
     // Add a IdDeclInfo vector 'pool'
-    IDIVecs.resize(IDIVecs.size() + 1);
+    IDIVecs.push_back(std::vector<IdDeclInfo>());
     // Fill the vector
     IDIVecs.back().resize(VECTOR_SIZE);
     CurIndex = 0;





More information about the cfe-commits mailing list