From: Vojtech Vilimek Date: Wed, 20 Jul 2022 10:55:30 +0000 (+0200) Subject: Remove duplicate code in proto/stats/stats.c X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe196ec397be10afc71742e34ad8789f3bb19a0e;p=thirdparty%2Fbird.git Remove duplicate code in proto/stats/stats.c --- diff --git a/proto/stats/stats.c b/proto/stats/stats.c index 069bc7df7..f5bf0ac64 100644 --- a/proto/stats/stats.c +++ b/proto/stats/stats.c @@ -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;