Skip to content

Commit 6d6854b

Browse files
ckennellycopybara-github
authored andcommitted
Use if constexpr around allocator type check for hashtable sampling.
PiperOrigin-RevId: 902662156 Change-Id: I20b0d521e3bff4fcbb47bd0ef71c2b10c87c02d7
1 parent 9aca3c8 commit 6d6854b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

absl/container/internal/raw_hash_set.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3044,7 +3044,9 @@ class raw_hash_set {
30443044
// construction when the size can fit in SOO capacity.
30453045
bool should_sample_soo() {
30463046
ABSL_SWISSTABLE_ASSERT(is_soo());
3047-
if (!ShouldSampleHashtablezInfoForAlloc<CharAlloc>()) return false;
3047+
if constexpr (!ShouldSampleHashtablezInfoForAlloc<CharAlloc>()) {
3048+
return false;
3049+
}
30483050
if (common().soo_has_tried_sampling()) {
30493051
// Already evaluated sampling on this SOO table; do not re-evaluate
30503052
// sampling each time it transitions from empty to full SOO state.

0 commit comments

Comments
 (0)