aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/llvm/ADT/DenseMap.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/llvm/ADT/DenseMap.h b/include/llvm/ADT/DenseMap.h
index 8b25a82..fd3f346 100644
--- a/include/llvm/ADT/DenseMap.h
+++ b/include/llvm/ADT/DenseMap.h
@@ -100,10 +100,12 @@ public:
const KeyT EmptyKey = getEmptyKey(), TombstoneKey = getTombstoneKey();
for (BucketT *P = Buckets, *E = Buckets+NumBuckets; P != E; ++P) {
- if (P->first != EmptyKey && P->first != TombstoneKey) {
+ if (P->first != EmptyKey) {
+ if (P->first != TombstoneKey) {
+ P->second.~ValueT();
+ --NumEntries;
+ }
P->first = EmptyKey;
- P->second.~ValueT();
- --NumEntries;
}
}
assert(NumEntries == 0 && "Node count imbalance!");