about summary refs log tree commit diff
path: root/absl/container
diff options
context:
space:
mode:
Diffstat (limited to 'absl/container')
-rw-r--r--absl/container/internal/hashtablez_sampler.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/absl/container/internal/hashtablez_sampler.cc b/absl/container/internal/hashtablez_sampler.cc
index 4aec0a07ffb3..6deeca44d97b 100644
--- a/absl/container/internal/hashtablez_sampler.cc
+++ b/absl/container/internal/hashtablez_sampler.cc
@@ -196,12 +196,10 @@ HashtablezInfo* SampleSlow(int64_t* next_sample) {
   return nullptr;
 #else
   bool first = *next_sample < 0;
-  *next_sample = g_exponential_biased_generator.Get(
+  *next_sample = g_exponential_biased_generator.GetStride(
       g_hashtablez_sample_parameter.load(std::memory_order_relaxed));
   // Small values of interval are equivalent to just sampling next time.
-  if (*next_sample < 1) {
-    *next_sample = 1;
-  }
+  ABSL_ASSERT(*next_sample >= 1);
 
   // g_hashtablez_enabled can be dynamically flipped, we need to set a threshold
   // low enough that we will start sampling in a reasonable time, so we just use