summaryrefslogtreecommitdiff
path: root/ldpd/ldp_debug.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2016-12-13 15:29:35 -0200
committerRenato Westphal <renato@opensourcerouting.org>2017-01-03 22:07:13 -0200
commit7d3d7491a0bc4b04ee6f65e26ae5f115df5a34f1 (patch)
treeaec70f72465b112b1acf7135169c8678fd49d967 /ldpd/ldp_debug.c
parentd3e1887ad6b5ae2199710b3278c277838e6ef913 (diff)
ldpd: use red-black trees to store 'iface' 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>
Diffstat (limited to 'ldpd/ldp_debug.c')
-rw-r--r--ldpd/ldp_debug.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ldpd/ldp_debug.c b/ldpd/ldp_debug.c
index 15dd06a0f3..86b679d8aa 100644
--- a/ldpd/ldp_debug.c
+++ b/ldpd/ldp_debug.c
@@ -74,7 +74,7 @@ ldp_vty_debug(struct vty *vty, struct vty_arg *args[])
DEBUG_OFF(event, EVENT);
else
DEBUG_ON(event, EVENT);
- } else if (strcmp(type_str, "messages") == 0) {
+ } else if (strcmp(type_str, "messages") == 0) {
all = (vty_get_arg_value(args, "all")) ? 1 : 0;
dir_str = vty_get_arg_value(args, "dir");
if (dir_str == NULL)
@@ -99,7 +99,7 @@ ldp_vty_debug(struct vty *vty, struct vty_arg *args[])
DEBUG_ON(msg, MSG_SEND_ALL);
}
}
- } else if (strcmp(type_str, "zebra") == 0) {
+ } else if (strcmp(type_str, "zebra") == 0) {
if (disable)
DEBUG_OFF(zebra, ZEBRA);
else