]> 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)
committermergify-bot <noreply@mergify.io>
Sat, 24 Jul 2021 16:12:51 +0000 (16:12 +0000)
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>
(cherry picked from commit ce40c6279a46dde35e25a6d31416e4e1ce519a18)

bgpd/bgp_evpn.c

index 8c5829905ef7edc546c46d49081f307a5c8d390c..2d12288ed7a9ed0e879ddeaa5a4556322358c01e 100644 (file)
@@ -88,11 +88,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)