[llvm] r175799 - Clear the whole table including the tombstones, since the tombstone count will

Pedro Artigas partigas at apple.com
Thu Feb 21 13:32:00 PST 2013


Author: partigas
Date: Thu Feb 21 15:32:00 2013
New Revision: 175799

URL: http://llvm.org/viewvc/llvm-project?rev=175799&view=rev
Log:
Clear the whole table including the tombstones, since the tombstone count will
be set to zero that is what it was intended. Should improve performance of 
the data structure when clear is invoked frequently (both compile time and
memory usage).

Modified:
    llvm/trunk/include/llvm/ADT/StringMap.h

Modified: llvm/trunk/include/llvm/ADT/StringMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/StringMap.h?rev=175799&r1=175798&r2=175799&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/StringMap.h (original)
+++ llvm/trunk/include/llvm/ADT/StringMap.h Thu Feb 21 15:32:00 2013
@@ -338,8 +338,8 @@ public:
       StringMapEntryBase *&Bucket = TheTable[I];
       if (Bucket && Bucket != getTombstoneVal()) {
         static_cast<MapEntryTy*>(Bucket)->Destroy(Allocator);
-        Bucket = 0;
       }
+      Bucket = 0;
     }
 
     NumItems = 0;





More information about the llvm-commits mailing list