[llvm-branch-commits] [llvm-branch] r70573 - in /llvm/branches/Apple/Dib: include/llvm/ADT/DenseMap.h unittests/ADT/DenseSetTest.cpp

Bill Wendling isanbard at gmail.com
Fri May 1 14:02:55 PDT 2009


Author: void
Date: Fri May  1 16:02:55 2009
New Revision: 70573

URL: http://llvm.org/viewvc/llvm-project?rev=70573&view=rev
Log:
--- Merging r70572 into '.':
U    include/llvm/ADT/DenseMap.h
A    unittests/ADT/DenseSetTest.cpp


Added:
    llvm/branches/Apple/Dib/unittests/ADT/DenseSetTest.cpp
      - copied unchanged from r70572, llvm/trunk/unittests/ADT/DenseSetTest.cpp
Modified:
    llvm/branches/Apple/Dib/include/llvm/ADT/DenseMap.h

Modified: llvm/branches/Apple/Dib/include/llvm/ADT/DenseMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/include/llvm/ADT/DenseMap.h?rev=70573&r1=70572&r2=70573&view=diff

==============================================================================
--- llvm/branches/Apple/Dib/include/llvm/ADT/DenseMap.h (original)
+++ llvm/branches/Apple/Dib/include/llvm/ADT/DenseMap.h Fri May  1 16:02:55 2009
@@ -345,12 +345,12 @@
     // probe almost the entire table until it found the empty bucket.  If the
     // table completely filled with tombstones, no lookup would ever succeed,
     // causing infinite loops in lookup.
+    ++NumEntries;
     if (NumEntries*4 >= NumBuckets*3 ||
         NumBuckets-(NumEntries+NumTombstones) < NumBuckets/8) {
       this->grow(NumBuckets * 2);
       LookupBucketFor(Key, TheBucket);
     }
-    ++NumEntries;
 
     // If we are writing over a tombstone, remember this.
     if (!KeyInfoT::isEqual(TheBucket->first, getEmptyKey()))





More information about the llvm-branch-commits mailing list