]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
remove old code
authorSvetlana Shmidt <sshmidt@google.com>
Tue, 8 Sep 2020 12:55:13 +0000 (12:55 +0000)
committerSvetlana Shmidt <sshmidt@google.com>
Tue, 8 Sep 2020 12:55:13 +0000 (12:55 +0000)
src/daemon/distribution.c

index 7fcbd22916d290a9f05cccbc48225f986bb397ff..84aba32d9eb363ecc8f77dee1423d173a312d1c0 100644 (file)
@@ -426,38 +426,3 @@ int distribution_sub(distribution_t *d1, distribution_t *d2) {
   return 0;
 }
 
-/*int distribution_sub(distribution_t *d1, distribution_t *d2) {
-  if (d1 == NULL || d2 == NULL) {
-    return errno = EINVAL;
-  }
-
-  if (d1->num_buckets != d2->num_buckets) {
-    return errno = EINVAL;
-  }
-
-  pthread_mutex_lock(&d1->mutex);
-  pthread_mutex_lock(&d2->mutex);
-
-  if (d1->total_sum < d2->total_sum) {
-    pthread_mutex_unlock(&d1->mutex);
-    pthread_mutex_unlock(&d2->mutex);
-    return ERANGE;
-  } else {
-    d1->total_sum -= d2->total_sum;
-    for (size_t i = 0; i < tree_size(d1->num_buckets); ++i) {
-      if (d1->tree[i].maximum != d2->tree[i].maximum ||
-          d1->tree[i].bucket_counter < d2->tree[i].bucket_counter) {
-        pthread_mutex_unlock(&d2->mutex);
-        pthread_mutex_unlock(&d1->mutex);
-        return errno = EINVAL;
-      }
-
-      d1->tree[i].bucket_counter -= d2->tree[i].bucket_counter;
-    }
-  }
-
-  pthread_mutex_unlock(&d2->mutex);
-  pthread_mutex_unlock(&d1->mutex);
-
-  return 0;
-}*/