@@ -222,7 +222,10 @@ int64_t hdr_size_of_equivalent_value_range(const struct hdr_histogram* h, int64_
222
222
return INT64_C (1 ) << (h -> unit_magnitude + adjusted_bucket );
223
223
}
224
224
225
- static int64_t hdr_size_of_equivalent_value_range_given_bucket_indices (const struct hdr_histogram * h , int64_t value , int32_t bucket_index , int32_t sub_bucket_index )
225
+ static int64_t size_of_equivalent_value_range_given_bucket_indices (
226
+ const struct hdr_histogram * h ,
227
+ int32_t bucket_index ,
228
+ int32_t sub_bucket_index )
226
229
{
227
230
const int32_t adjusted_bucket = (sub_bucket_index >= h -> sub_bucket_count ) ? (bucket_index + 1 ) : bucket_index ;
228
231
return INT64_C (1 ) << (h -> unit_magnitude + adjusted_bucket );
@@ -235,7 +238,10 @@ static int64_t lowest_equivalent_value(const struct hdr_histogram* h, int64_t va
235
238
return value_from_index (bucket_index , sub_bucket_index , h -> unit_magnitude );
236
239
}
237
240
238
- static int64_t lowest_equivalent_value_given_bucket_indices (const struct hdr_histogram * h , int64_t value , int32_t bucket_index , int32_t sub_bucket_index )
241
+ static int64_t lowest_equivalent_value_given_bucket_indices (
242
+ const struct hdr_histogram * h ,
243
+ int32_t bucket_index ,
244
+ int32_t sub_bucket_index )
239
245
{
240
246
return value_from_index (bucket_index , sub_bucket_index , h -> unit_magnitude );
241
247
}
@@ -811,8 +817,9 @@ static bool move_next(struct hdr_iter* iter)
811
817
const int64_t value = hdr_value_at_index (iter -> h , iter -> counts_index );
812
818
const int32_t bucket_index = get_bucket_index (iter -> h , value );
813
819
const int32_t sub_bucket_index = get_sub_bucket_index (value , bucket_index , iter -> h -> unit_magnitude );
814
- const int64_t leq = lowest_equivalent_value_given_bucket_indices (iter -> h , value , bucket_index , sub_bucket_index );
815
- const int64_t size_of_equivalent_value_range = hdr_size_of_equivalent_value_range_given_bucket_indices (iter -> h , value , bucket_index , sub_bucket_index );
820
+ const int64_t leq = lowest_equivalent_value_given_bucket_indices (iter -> h , bucket_index , sub_bucket_index );
821
+ const int64_t size_of_equivalent_value_range = size_of_equivalent_value_range_given_bucket_indices (
822
+ iter -> h , bucket_index , sub_bucket_index );
816
823
iter -> lowest_equivalent_value = leq ;
817
824
iter -> value = value ;
818
825
iter -> highest_equivalent_value = leq + size_of_equivalent_value_range - 1 ;
0 commit comments