tail plugin: Implement the "GaugePersist" type.
[collectd.git] / src / daemon / utils_match.c
index 914b6e2..31ee6df 100644 (file)
@@ -295,14 +295,13 @@ cu_match_t *match_create_simple (const char *regex,
 
 void match_value_reset (cu_match_value_t *mv)
 {
-  if (mv == NULL)
+  if ((mv == NULL)
+      || ((mv->ds_type & UTILS_MATCH_DS_TYPE_GAUGE) == 0)
+      || ((mv->ds_type & UTILS_MATCH_CF_GAUGE_PERSIST) != 0))
     return;
 
-  if (mv->ds_type & UTILS_MATCH_DS_TYPE_GAUGE)
-  {
-    mv->value.gauge = NAN;
-    mv->values_num = 0;
-  }
+  mv->value.gauge = NAN;
+  mv->values_num = 0;
 } /* }}} void match_value_reset */
 
 void match_destroy (cu_match_t *obj)