[llvm-commits] [llvm] r41834 - /llvm/trunk/include/llvm/ADT/DenseMap.h
Owen Anderson
resistor at mac.com
Mon Sep 10 21:43:51 PDT 2007
Author: resistor
Date: Mon Sep 10 23:43:51 2007
New Revision: 41834
URL: http://llvm.org/viewvc/llvm-project?rev=41834&view=rev
Log:
Don't bother to initialize values corresponding to empty or tombstone
keys.
Modified:
llvm/trunk/include/llvm/ADT/DenseMap.h
Modified: llvm/trunk/include/llvm/ADT/DenseMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/DenseMap.h?rev=41834&r1=41833&r2=41834&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/DenseMap.h (original)
+++ llvm/trunk/include/llvm/ADT/DenseMap.h Mon Sep 10 23:43:51 2007
@@ -203,7 +203,9 @@
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;
}
More information about the llvm-commits
mailing list