mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-11 18:48:14 +00:00
zebra: Check active count first in nhg_hash_equal
Before checking the equivalence of the whole group itself, check to see if they contain the same number of non-recursive active nexthops. This should shorten lookup time for the case of non-resolved nexthop group creation. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
This commit is contained in:
parent
6384cbcb0e
commit
e4ac313b12
@ -387,13 +387,13 @@ bool zebra_nhg_hash_equal(const void *arg1, const void *arg2)
|
||||
if (nhe1->afi != nhe2->afi)
|
||||
return false;
|
||||
|
||||
if (!nexthop_group_equal(nhe1->nhg, nhe2->nhg))
|
||||
return false;
|
||||
|
||||
if (nexthop_group_active_nexthop_num_no_recurse(nhe1->nhg)
|
||||
!= nexthop_group_active_nexthop_num_no_recurse(nhe2->nhg))
|
||||
return false;
|
||||
|
||||
if (!nexthop_group_equal(nhe1->nhg, nhe2->nhg))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user