Skip to content

Commit

Permalink
bgpd: Do not check for NULL values for vni_hash_cmp()
Browse files Browse the repository at this point in the history
There is no need to test for null values in the hash compare
function as that we are guaranteed to send in data in
the hash compare functions.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
  • Loading branch information
ton31337 committed Jul 13, 2021
1 parent 507559a commit ce40c62
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions bgpd/bgp_evpn.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,7 @@ static bool vni_hash_cmp(const void *p1, const void *p2)
const struct bgpevpn *vpn1 = p1;
const struct bgpevpn *vpn2 = p2;

if (!vpn1 && !vpn2)
return true;
if (!vpn1 || !vpn2)
return false;
return (vpn1->vni == vpn2->vni);
return vpn1->vni == vpn2->vni;
}

int vni_list_cmp(void *p1, void *p2)
Expand Down

0 comments on commit ce40c62

Please sign in to comment.