about summary refs log tree commit diff
path: root/absl/base/internal/periodic_sampler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'absl/base/internal/periodic_sampler.cc')
-rw-r--r--absl/base/internal/periodic_sampler.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/absl/base/internal/periodic_sampler.cc b/absl/base/internal/periodic_sampler.cc
index 439745d0c514..69656c8a0fbe 100644
--- a/absl/base/internal/periodic_sampler.cc
+++ b/absl/base/internal/periodic_sampler.cc
@@ -36,13 +36,13 @@ bool PeriodicSamplerBase::SubtleConfirmSample() noexcept {
 
   // Check if this is the first call to Sample()
   if (ABSL_PREDICT_FALSE(stride_ == 1)) {
-    stride_ = -1 - GetExponentialBiased(current_period);
-    if (stride_ < -1) {
+    stride_ = static_cast<uint64_t>(-1 - GetExponentialBiased(current_period));
+    if (static_cast<int64_t>(stride_) < -1) {
       ++stride_;
       return false;
     }
   }
-  stride_ = -1 - GetExponentialBiased(current_period);
+  stride_ = static_cast<uint64_t>(-1 - GetExponentialBiased(current_period));
   return true;
 }