From 191b2c750263579de68b9d4f6eb5b5d529b112db Mon Sep 17 00:00:00 2001 From: Pranav Sharma <83678994+spran180@users.noreply.github.com> Date: Thu, 25 Jul 2024 15:46:51 +0530 Subject: [PATCH] addressed issues --- src/internal_modules/roc_core/mov_histogram.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/internal_modules/roc_core/mov_histogram.h b/src/internal_modules/roc_core/mov_histogram.h index 5a97ff889..d425ed49c 100644 --- a/src/internal_modules/roc_core/mov_histogram.h +++ b/src/internal_modules/roc_core/mov_histogram.h @@ -54,7 +54,7 @@ template class MovHistogram { "than 0 and value_range_min must be less than value_range_max"); } - bin_width_ = (value_range_max - value_range_min) / num_bins; + bin_width_ = (value_range_max - value_range_min) / static_cast(num_bins); if (!ring_buffer_.is_valid() || !bins_.resize(num_bins)) { return; @@ -82,9 +82,7 @@ template class MovHistogram { T oldest_value = ring_buffer_.front(); ring_buffer_.pop_front(); size_t oldest_bin_index = get_bin_index_(oldest_value); - if (oldest_bin_index < num_bins_) { - bins_[oldest_bin_index]--; - } + bins_[oldest_bin_index]--; } ring_buffer_.push_back(clamped_value);