From 0a8dfbec4531056d1451ed2a397f9fa5af9e9284 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sun, 25 Feb 2024 08:07:21 -0500 Subject: [PATCH] bgpd: Simplify for loop This for loop has no chance of removing entries so there is no need to do a bit of complicated code to handle the case where an entry can be removed. Signed-off-by: Donald Sharp --- bgpd/bgp_route.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index c91745030da8..45951e9ea88c 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -2907,9 +2907,7 @@ void bgp_best_selection(struct bgp *bgp, struct bgp_dest *dest, } if (do_mpath && new_select) { - for (pi = bgp_dest_get_bgp_path_info(dest); - (pi != NULL) && (nextpi = pi->next, 1); pi = nextpi) { - + for (pi = bgp_dest_get_bgp_path_info(dest); pi; pi = pi->next) { if (debug) bgp_path_info_path_with_addpath_rx_str( pi, path_buf, sizeof(path_buf));