| 25 | /* ###### ####### ####### ## ## ## ###### */ |
| 26 | |
| 27 | static int32_t normalize_index(const struct hdr_histogram* h, int32_t index) |
| 28 | { |
| 29 | int32_t normalized_index; |
| 30 | int32_t adjustment = 0; |
| 31 | if (h->normalizing_index_offset == 0) |
| 32 | { |
| 33 | return index; |
| 34 | } |
| 35 | |
| 36 | normalized_index = index - h->normalizing_index_offset; |
| 37 | |
| 38 | if (normalized_index < 0) |
| 39 | { |
| 40 | adjustment = h->counts_len; |
| 41 | } |
| 42 | else if (normalized_index >= h->counts_len) |
| 43 | { |
| 44 | adjustment = -h->counts_len; |
| 45 | } |
| 46 | |
| 47 | return normalized_index + adjustment; |
| 48 | } |
| 49 | |
| 50 | static int64_t counts_get_direct(const struct hdr_histogram* h, int32_t index) |
| 51 | { |
no outgoing calls
no test coverage detected