]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Remove duplicate code in proto/stats/stats.c
authorVojtech Vilimek <vojtech.vilimek@nic.cz>
Wed, 20 Jul 2022 10:55:30 +0000 (12:55 +0200)
committerVojtech Vilimek <vojtech.vilimek@nic.cz>
Wed, 20 Jul 2022 10:55:30 +0000 (12:55 +0200)
proto/stats/stats.c

index 069bc7df764b35823704d3ddcb9338c55fd9f4d8..f5bf0ac647498d4cb8c008d49daa044c393a9b5e 100644 (file)
@@ -88,17 +88,6 @@ stats_init(struct proto_config *CF)
   return P;
 }
 
-static struct channel *
-stats_find_channel(struct stats_proto *p, const char *name)
-{
-  struct channel *c;
-  WALK_LIST(c, p->p.channels)
-    if (strcmp(c->name, name))
-      return c;
-
-  return NULL;
-}
 static int
 stats_start(struct proto *P UNUSED) 
 {
@@ -118,7 +107,7 @@ stats_reconfigure(struct proto *P, struct proto_config *CF)
   struct channel_config *cc;
   WALK_LIST(cc, new->c.channels)
   {
-    c = (struct channel *) stats_find_channel(p, cc->name);
+    c = proto_find_channel_by_name(P, cc->name);
     if (!proto_configure_channel(P, &c, cc))
       return 0;