From: Owen Anderson Date: Tue, 11 Sep 2007 04:43:51 +0000 (+0000) Subject: Don't bother to initialize values corresponding to empty or tombstone X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=98153ecbc1b29c576ff43a7718c3f657f81b8aac;p=oota-llvm.git Don't bother to initialize values corresponding to empty or tombstone keys. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41834 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/ADT/DenseMap.h b/include/llvm/ADT/DenseMap.h index fe912404cd9..43382492856 100644 --- a/include/llvm/ADT/DenseMap.h +++ b/include/llvm/ADT/DenseMap.h @@ -203,7 +203,9 @@ private: else for (size_t i = 0; i < other.NumBuckets; ++i) { new (Buckets[i].first) KeyT(other.Buckets[i].first); - new (Buckets[i].second) ValueT(other.Buckets[i].second); + if (Buckets[i].first != getEmptyKey() && + Buckets[i].first != getTombstoneKey()) + new (Buckets[i].second) ValueT(other.Buckets[i].second); } NumBuckets = other.NumBuckets; }