Skip to content

Commit

Permalink
Fix a potential precision loss on integer in ReservoirCellIndexFor
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomsonTan committed Oct 17, 2022
1 parent 7f37bc3 commit de9bb0a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ class HistogramExemplarReservoir : public FixedSizeExemplarReservoir
const MetricAttributes & /* attributes */,
const opentelemetry::context::Context & /* context */) override
{
int max_size = boundaries_.size();
for (int i = 0; i < max_size; ++i)
size_t max_size = boundaries_.size();
for (size_t i = 0; i < max_size; ++i)
{
if (value <= boundaries_[i])
{
return i;
return static_cast<int>(i);
}
}
return -1;
Expand Down

0 comments on commit de9bb0a

Please sign in to comment.