]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Do not check for NULL values for vni_hash_cmp()
authorDonatas Abraitis <donatas.abraitis@gmail.com>
Tue, 13 Jul 2021 05:46:10 +0000 (08:46 +0300)
committerDonatas Abraitis <donatas.abraitis@gmail.com>
Tue, 13 Jul 2021 05:46:52 +0000 (08:46 +0300)
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>
bgpd/bgp_evpn.c

index c99f539c7b72ec6d9e157f610b0a12a22b7c61b5..3d8c4e3ae640beb1ec1d78374fc98d278bffc2cd 100644 (file)
@@ -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)