]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Small changes
authorIgor Putovny <igor.putovny@nic.cz>
Mon, 9 Dec 2024 17:28:28 +0000 (18:28 +0100)
committerIgor Putovny <igor.putovny@nic.cz>
Mon, 9 Dec 2024 17:41:06 +0000 (18:41 +0100)
proto/aggregator/aggregator.c

index bdcc3ff924e191ccba5cf34a1bdc509ff203a285..08c38dc458bb21f612dd3a7f3c1fa9598d4b5728 100644 (file)
@@ -118,7 +118,7 @@ create_new_node(linpool *trie_pool)
 }
 
 /*
- * Mark appropriate child of parent node as NULL
+ * Unlink node from the trie by setting appropriate child of parent node to NULL
  */
 static inline void
 remove_node(struct trie_node *node)
@@ -181,6 +181,26 @@ get_new_bucket_id(struct aggregator_proto *p)
   return id;
 }
 
+static inline struct aggregator_bucket *
+choose_lowest_id_bucket(const struct aggregator_proto *p, const struct trie_node *node)
+{
+  assert(p != NULL);
+  assert(node != NULL);
+
+  for (u32 i = 0; i < MAX_POTENTIAL_BUCKETS_COUNT; i++)
+  {
+    if (BIT32R_TEST(node->potential_buckets, i))
+    {
+      struct aggregator_bucket *bucket = get_bucket_ptr(p, i);
+      assert(bucket != NULL);
+      assert(bucket->id == i);
+      return bucket;
+    }
+  }
+
+  bug("No bucket to choose from");
+}
+
 static inline int
 popcount32(u32 x)
 {
@@ -389,26 +409,6 @@ before_check(const struct trie_node *node)
     before_check(node->child[1]);
 }
 
-static struct aggregator_bucket *
-choose_lowest_id_bucket(const struct aggregator_proto *p, const struct trie_node *node)
-{
-  assert(p != NULL);
-  assert(node != NULL);
-
-  for (u32 i = 0; i < MAX_POTENTIAL_BUCKETS_COUNT; i++)
-  {
-    if (BIT32R_TEST(node->potential_buckets, i))
-    {
-      struct aggregator_bucket *bucket = get_bucket_ptr(p, i);
-      assert(bucket != NULL);
-      assert(bucket->id == i);
-      return bucket;
-    }
-  }
-
-  bug("No bucket to choose from");
-}
-
 /*
  * First pass of Optimal Route Table Construction (ORTC) algorithm
  */
@@ -750,7 +750,7 @@ deaggregate(struct trie_node *node)
 
 /*
  * Merge sets of potential buckets from @node upwards.
- * Stop when sets do not change and return the last updated node.
+ * Stop when sets don't change and return the last updated node.
  */
 static struct trie_node *
 merge_buckets_above(struct trie_node *node)