]> git.proxmox.com Git - mirror_frr.git/commit - ldpd/ldpe.c
ldpd: use red-black trees to store 'nbr_params' elements
authorRenato Westphal <renato@opensourcerouting.org>
Wed, 14 Dec 2016 11:14:52 +0000 (09:14 -0200)
committerRenato Westphal <renato@opensourcerouting.org>
Wed, 4 Jan 2017 00:07:13 +0000 (22:07 -0200)
commit76c4abd19f322288394be872c9198c7d17cfac10
tree7135c07742879dc2d4d74c830be8a62dbe3f8a91
parent7989cdba45f631fb14d1bcaf7103c9db25605971
ldpd: use red-black trees to store 'nbr_params' elements

Using red-black trees instead of linked lists brings the following
benefits:
1 - Elements are naturally ordered (no need to reorder anything before
    outputting data to the user);
2 - Faster lookups/deletes: O(log n) time complexity against O(n).

The insert operation with red-black trees is more expensive though,
but that's not a big issue since lookups are much more frequent.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
ldpd/lde.c
ldpd/ldp_vty_conf.c
ldpd/ldpd.c
ldpd/ldpd.h
ldpd/ldpe.c
ldpd/neighbor.c