Skip to content

Commit

Permalink
bgpd: Simplify for loop
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
donaldsharp committed Mar 3, 2024
1 parent f9c8673 commit 0a8dfbe
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions bgpd/bgp_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 0a8dfbe

Please sign in to comment.