diff options
Diffstat (limited to 'web/api/queries/min')
-rw-r--r-- | web/api/queries/min/min.c | 15 | ||||
-rw-r--r-- | web/api/queries/min/min.h | 2 |
2 files changed, 7 insertions, 10 deletions
diff --git a/web/api/queries/min/min.c b/web/api/queries/min/min.c index 9bd7460e0..497bae04d 100644 --- a/web/api/queries/min/min.c +++ b/web/api/queries/min/min.c @@ -10,9 +10,8 @@ struct grouping_min { size_t count; }; -void *grouping_create_min(RRDR *r) { - (void)r; - return callocz(1, sizeof(struct grouping_min)); +void grouping_create_min(RRDR *r) { + r->internal.grouping_data = callocz(1, sizeof(struct grouping_min)); } // resets when switches dimensions @@ -29,13 +28,11 @@ void grouping_free_min(RRDR *r) { } void grouping_add_min(RRDR *r, calculated_number value) { - if(!isnan(value)) { - struct grouping_min *g = (struct grouping_min *)r->internal.grouping_data; + struct grouping_min *g = (struct grouping_min *)r->internal.grouping_data; - if(!g->count || calculated_number_fabs(value) < calculated_number_fabs(g->min)) { - g->min = value; - g->count++; - } + if(!g->count || calculated_number_fabs(value) < calculated_number_fabs(g->min)) { + g->min = value; + g->count++; } } diff --git a/web/api/queries/min/min.h b/web/api/queries/min/min.h index 74703605c..9207c74f7 100644 --- a/web/api/queries/min/min.h +++ b/web/api/queries/min/min.h @@ -6,7 +6,7 @@ #include "../query.h" #include "../rrdr.h" -extern void *grouping_create_min(RRDR *r); +extern void grouping_create_min(RRDR *r); extern void grouping_reset_min(RRDR *r); extern void grouping_free_min(RRDR *r); extern void grouping_add_min(RRDR *r, calculated_number value); |