From: Elene Margalitadze <68648605+elene-margalit@users.noreply.github.com> Date: Mon, 17 Aug 2020 15:35:56 +0000 (+0200) Subject: Revert "Formatted the code." X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3d5c88b3dda7d7a2674aa1927ea18eaeaee0546f;p=thirdparty%2Fcollectd.git Revert "Formatted the code." This reverts commit 9948fdcad48786b45445eb3b85af24e1e22797e0. --- diff --git a/src/daemon/metric.c b/src/daemon/metric.c index 2d9f93810..2196b36ff 100644 --- a/src/daemon/metric.c +++ b/src/daemon/metric.c @@ -205,7 +205,7 @@ int metric_reset(metric_t *m) { label_set_reset(&m->label); meta_data_destroy(m->meta); - if (m->family->type == METRIC_TYPE_DISTRIBUTION) { + if(m->family->type == METRIC_TYPE_DISTRIBUTION) { distribution_destroy(m->value.distribution); } @@ -349,18 +349,18 @@ static int metric_list_clone(metric_list_t *dest, metric_list_t src, for (size_t i = 0; i < src.num; i++) { - ret.ptr[i] = (metric_t){ + ret.ptr[i] = (metric_t){ .family = fam, .time = src.ptr[i].time, .interval = src.ptr[i].interval, - }; + }; - if (src.ptr[i].family->type == METRIC_TYPE_DISTRIBUTION) { - ret.ptr[i].value.distribution = - distribution_clone(src.ptr[i].value.distribution); - } else { - ret.ptr[i].value = src.ptr[i].value; - } + if(src.ptr[i].family->type == METRIC_TYPE_DISTRIBUTION) { + ret.ptr[i].value.distribution = distribution_clone(src.ptr[i].value.distribution); + } + else { + ret.ptr[i].value = src.ptr[i].value; + } int status = label_set_clone(&ret.ptr[i].label, src.ptr[i].label); if (status != 0) { @@ -633,3 +633,4 @@ metric_t *metric_parse_identity(char const *buf) { return fam->metric.ptr; } +