From eabfbdbd0512d96339338bb0c71bead29ceb110c Mon Sep 17 00:00:00 2001 From: Igor Putovny Date: Thu, 23 Jan 2025 17:12:01 +0100 Subject: [PATCH] Move code around --- proto/aggregator/aggregator.c | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/proto/aggregator/aggregator.c b/proto/aggregator/aggregator.c index a0428f461..7c8b17e64 100644 --- a/proto/aggregator/aggregator.c +++ b/proto/aggregator/aggregator.c @@ -157,6 +157,19 @@ node_insert_potential_bucket(struct trie_node *node, const struct aggregator_buc node->potential_buckets_count++; } +/* + * Check if @bucket is one of potential buckets in @node + */ +static int +is_bucket_potential(const struct trie_node *node, const struct aggregator_bucket *bucket) +{ + assert(node != NULL); + assert(bucket != NULL); + + ASSERT_DIE(bucket->id < MAX_POTENTIAL_BUCKETS_COUNT); + return BIT32R_TEST(node->potential_buckets, bucket->id); +} + /* * Return pointer to bucket with ID @id. * Protocol contains list of pointers to all buckets. Every pointer @@ -595,27 +608,6 @@ second_pass(struct trie_node *node) assert(node->selected_bucket == NULL); } -/* - * Check if @bucket is one of potential buckets in @node - */ -static int -is_bucket_potential(const struct trie_node *node, const struct aggregator_bucket *bucket) -{ - assert(node != NULL); - assert(bucket != NULL); - - ASSERT_DIE(bucket->id < MAX_POTENTIAL_BUCKETS_COUNT); - return BIT32R_TEST(node->potential_buckets, bucket->id); -} - -static void -remove_potential_buckets(struct trie_node *node) -{ - assert(node != NULL); - node->potential_buckets_count = 0; - memset(node->potential_buckets, 0, sizeof(node->potential_buckets)); -} - static void third_pass_helper(struct aggregator_proto *p, struct trie_node *node) { -- 2.47.2