We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7671dd1 commit aa4eed7Copy full SHA for aa4eed7
1 file changed
src/hdr_histogram.c
@@ -111,8 +111,15 @@ static void counts_inc_normalised_atomic(
111
112
static void update_min_max(struct hdr_histogram* h, int64_t value)
113
{
114
- h->min_value = (value < h->min_value && value != 0) ? value : h->min_value;
115
- h->max_value = (value > h->max_value) ? value : h->max_value;
+ if (HDR_UNLIKELY(value > h->max_value))
+ {
116
+ h->max_value = value;
117
+ }
118
+
119
+ if (HDR_UNLIKELY(value != 0 && value < h->min_value))
120
121
+ h->min_value = value;
122
123
}
124
125
static void update_min_max_atomic(struct hdr_histogram* h, int64_t value)
0 commit comments