summaryrefslogtreecommitdiffstats
path: root/web/api/queries/max
diff options
context:
space:
mode:
Diffstat (limited to 'web/api/queries/max')
-rw-r--r--web/api/queries/max/max.c15
-rw-r--r--web/api/queries/max/max.h2
2 files changed, 7 insertions, 10 deletions
diff --git a/web/api/queries/max/max.c b/web/api/queries/max/max.c
index a4be36add..b6e723314 100644
--- a/web/api/queries/max/max.c
+++ b/web/api/queries/max/max.c
@@ -10,9 +10,8 @@ struct grouping_max {
size_t count;
};
-void *grouping_create_max(RRDR *r) {
- (void)r;
- return callocz(1, sizeof(struct grouping_max));
+void grouping_create_max(RRDR *r) {
+ r->internal.grouping_data = callocz(1, sizeof(struct grouping_max));
}
// resets when switches dimensions
@@ -29,13 +28,11 @@ void grouping_free_max(RRDR *r) {
}
void grouping_add_max(RRDR *r, calculated_number value) {
- if(!isnan(value)) {
- struct grouping_max *g = (struct grouping_max *)r->internal.grouping_data;
+ struct grouping_max *g = (struct grouping_max *)r->internal.grouping_data;
- if(!g->count || calculated_number_fabs(value) > calculated_number_fabs(g->max)) {
- g->max = value;
- g->count++;
- }
+ if(!g->count || calculated_number_fabs(value) > calculated_number_fabs(g->max)) {
+ g->max = value;
+ g->count++;
}
}
diff --git a/web/api/queries/max/max.h b/web/api/queries/max/max.h
index d839fe3f9..7b606ce34 100644
--- a/web/api/queries/max/max.h
+++ b/web/api/queries/max/max.h
@@ -6,7 +6,7 @@
#include "../query.h"
#include "../rrdr.h"
-extern void *grouping_create_max(RRDR *r);
+extern void grouping_create_max(RRDR *r);
extern void grouping_reset_max(RRDR *r);
extern void grouping_free_max(RRDR *r);
extern void grouping_add_max(RRDR *r, calculated_number value);