]> git.puffer.fish Git - mirror/frr.git/commit
ldpd: use red-black trees to store 'l2vpn_pw' elements
authorRenato Westphal <renato@opensourcerouting.org>
Wed, 14 Dec 2016 15:53:07 +0000 (13:53 -0200)
committerRenato Westphal <renato@opensourcerouting.org>
Wed, 15 Feb 2017 09:19:52 +0000 (07:19 -0200)
commita3cb56d84a5a0e71f9e0f96e476b857ff4f2942e
tree867e6cb2057cb03471fd8d03b34aab6d703f1264
parent7a09a2b1c4a888bd97b43bf5fc31383ca59e4352
ldpd: use red-black trees to store 'l2vpn_pw' 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/l2vpn.c
ldpd/lde.c
ldpd/ldp_vty_conf.c
ldpd/ldpd.c
ldpd/ldpd.h
ldpd/ldpe.c