diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-06-19 17:27:55 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-06-19 17:27:55 -0400 |
| commit | d368cd48b94cb9a22b9733200d8cfd94c71338ce (patch) | |
| tree | 5b8d5a6bcd026fac8bffad24fece194df9bf7232 /lib/ns.c | |
| parent | 2dc1ef552b453d9e2b31599ca8d4c065dc2ccbfc (diff) | |
| parent | b19ad86195435f6ef84ebf0303ba03d8f79cd7fc (diff) | |
Merge pull request #730 from opensourcerouting/rbtree-improvement
RB tree improvement
Diffstat (limited to 'lib/ns.c')
| -rw-r--r-- | lib/ns.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -39,7 +39,7 @@ DEFINE_MTYPE_STATIC(LIB, NS, "Logical-Router") DEFINE_MTYPE_STATIC(LIB, NS_NAME, "Logical-Router Name") -static __inline int ns_compare (struct ns *, struct ns *); +static __inline int ns_compare (const struct ns *, const struct ns *); static struct ns *ns_lookup (ns_id_t); RB_GENERATE (ns_head, ns, entry, ns_compare) @@ -108,7 +108,7 @@ static int ns_enable (struct ns *ns); static void ns_disable (struct ns *ns); static __inline int -ns_compare(struct ns *a, struct ns *b) +ns_compare(const struct ns *a, const struct ns *b) { return (a->ns_id - b->ns_id); } @@ -453,7 +453,7 @@ ns_terminate (void) { struct ns *ns; - while ((ns = RB_ROOT (&ns_tree)) != NULL) + while ((ns = RB_ROOT (ns_head, &ns_tree)) != NULL) ns_delete (ns); } |
