From 699cf390ff1e621a1fa78dd5b3e90cf6d2c10299 Mon Sep 17 00:00:00 2001 From: Pedro Artigas Date: Thu, 21 Feb 2013 21:32:00 +0000 Subject: [PATCH] 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). llvm-svn: 175799 --- llvm/include/llvm/ADT/StringMap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/include/llvm/ADT/StringMap.h b/llvm/include/llvm/ADT/StringMap.h index 7e40a07..d01437b 100644 --- a/llvm/include/llvm/ADT/StringMap.h +++ b/llvm/include/llvm/ADT/StringMap.h @@ -338,8 +338,8 @@ public: StringMapEntryBase *&Bucket = TheTable[I]; if (Bucket && Bucket != getTombstoneVal()) { static_cast(Bucket)->Destroy(Allocator); - Bucket = 0; } + Bucket = 0; } NumItems = 0; -- 2.7.4