summaryrefslogtreecommitdiff
path: root/absl/container/internal/raw_hash_set.h
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2024-01-30 12:52:43 -0800
committerGravatar Copybara-Service <copybara-worker@google.com>2024-01-30 12:53:38 -0800
commitc44dd5acd7848a175d1fb939cdb81a4cf8d4c912 (patch)
tree4f853927f1aa61dc3fd658dbba141f6d9148b1db /absl/container/internal/raw_hash_set.h
parent779a3565ac6c5b69dd1ab9183e500a27633117d5 (diff)
Early return from destroy_slots for trivially destructible types in flat_hash_{*}.
PiperOrigin-RevId: 602813933 Change-Id: I744fe438281755a141b2fd47e54ab9c6c0fad5a3
Diffstat (limited to 'absl/container/internal/raw_hash_set.h')
-rw-r--r--absl/container/internal/raw_hash_set.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/absl/container/internal/raw_hash_set.h b/absl/container/internal/raw_hash_set.h
index ba7df607..9f16a815 100644
--- a/absl/container/internal/raw_hash_set.h
+++ b/absl/container/internal/raw_hash_set.h
@@ -2881,6 +2881,7 @@ class raw_hash_set {
}
inline void destroy_slots() {
+ if (PolicyTraits::template destroy_is_trivial<Alloc>()) return;
const size_t cap = capacity();
const ctrl_t* ctrl = control();
slot_type* slot = slot_array();