Skip to content

Commit

Permalink
Remove unused value parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeb01 committed Feb 28, 2022
1 parent 1bc7ab0 commit 1ebb2c7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.5)

project(hdr_histogram VERSION 0.10.0 LANGUAGES C)
project(hdr_histogram VERSION 0.11.3 LANGUAGES C)

include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
Expand Down
15 changes: 11 additions & 4 deletions src/hdr_histogram.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,10 @@ int64_t hdr_size_of_equivalent_value_range(const struct hdr_histogram* h, int64_
return INT64_C(1) << (h->unit_magnitude + adjusted_bucket);
}

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)
static int64_t size_of_equivalent_value_range_given_bucket_indices(
const struct hdr_histogram *h,
int32_t bucket_index,
int32_t sub_bucket_index)
{
const int32_t adjusted_bucket = (sub_bucket_index >= h->sub_bucket_count) ? (bucket_index + 1) : bucket_index;
return INT64_C(1) << (h->unit_magnitude + adjusted_bucket);
Expand All @@ -235,7 +238,10 @@ static int64_t lowest_equivalent_value(const struct hdr_histogram* h, int64_t va
return value_from_index(bucket_index, sub_bucket_index, h->unit_magnitude);
}

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)
static int64_t lowest_equivalent_value_given_bucket_indices(
const struct hdr_histogram *h,
int32_t bucket_index,
int32_t sub_bucket_index)
{
return value_from_index(bucket_index, sub_bucket_index, h->unit_magnitude);
}
Expand Down Expand Up @@ -811,8 +817,9 @@ static bool move_next(struct hdr_iter* iter)
const int64_t value = hdr_value_at_index(iter->h, iter->counts_index);
const int32_t bucket_index = get_bucket_index(iter->h, value);
const int32_t sub_bucket_index = get_sub_bucket_index(value, bucket_index, iter->h->unit_magnitude);
const int64_t leq = lowest_equivalent_value_given_bucket_indices(iter->h, value, bucket_index, sub_bucket_index);
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);
const int64_t leq = lowest_equivalent_value_given_bucket_indices(iter->h, bucket_index, sub_bucket_index);
const int64_t size_of_equivalent_value_range = size_of_equivalent_value_range_given_bucket_indices(
iter->h, bucket_index, sub_bucket_index);
iter->lowest_equivalent_value = leq;
iter->value = value;
iter->highest_equivalent_value = leq + size_of_equivalent_value_range - 1;
Expand Down

0 comments on commit 1ebb2c7

Please sign in to comment.