summaryrefslogtreecommitdiff
path: root/lib/routemap.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2022-10-19 12:57:28 -0400
committerDonald Sharp <sharpd@nvidia.com>2022-10-20 07:43:45 -0400
commit78946603e10489969bad3b364a96ca01d436b47d (patch)
tree358d8c9b9fc3cc404ef81412e2d0bbd67d3141a7 /lib/routemap.c
parent040a0e6d26cb446806f940130c2fac95c2b0f441 (diff)
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 <sharpd@nvidia.com>
Diffstat (limited to 'lib/routemap.c')
-rw-r--r--lib/routemap.c7
1 files changed, 1 insertions, 6 deletions
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;
}
/*