From: Donatas Abraitis Date: Tue, 13 Jul 2021 05:46:10 +0000 (+0300) Subject: bgpd: Do not check for NULL values for vni_hash_cmp() X-Git-Tag: frr-8.0.1~58^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=393bf3ed70dfc15c092cd597de55723fafb1a118;p=matthieu%2Ffrr.git bgpd: Do not check for NULL values for vni_hash_cmp() 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 (cherry picked from commit ce40c6279a46dde35e25a6d31416e4e1ce519a18) --- diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c index 8c5829905e..2d12288ed7 100644 --- a/bgpd/bgp_evpn.c +++ b/bgpd/bgp_evpn.c @@ -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)