From: Donald Sharp Date: Wed, 19 Oct 2022 16:57:28 +0000 (-0400) Subject: lib: Remove unnecessary comparison, for linked list X-Git-Tag: base_8.5~321^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=78946603e10489969bad3b364a96ca01d436b47d;p=mirror%2Ffrr.git lib: Remove unnecessary comparison, for linked list In the comparison function for a linked list code was always checking against passed in NULL's. The comparison function will never receive a NULL value for data from the linklist.c code. Signed-off-by: Donald Sharp --- diff --git a/lib/routemap.c b/lib/routemap.c index dcaecd8085..44d7185567 100644 --- a/lib/routemap.c +++ b/lib/routemap.c @@ -1907,12 +1907,7 @@ route_map_get_index(struct route_map *map, const struct prefix *prefix, static int route_map_candidate_list_cmp(struct route_map_index *idx1, struct route_map_index *idx2) { - if (!idx1) - return -1; - if (!idx2) - return 1; - - return (idx1->pref - idx2->pref); + return idx1->pref - idx2->pref; } /*