From 8abbde02d46830168b79a1df6c18c3ffaea49b9e Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Mon, 8 May 2000 19:11:49 +0000 Subject: Several simplifications of the fib iterators. --- nest/rt-fib.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'nest/rt-fib.c') diff --git a/nest/rt-fib.c b/nest/rt-fib.c index fb1be6e2..22ba2ff6 100644 --- a/nest/rt-fib.c +++ b/nest/rt-fib.c @@ -163,20 +163,20 @@ fib_merge_readers(struct fib_iterator *i, struct fib_node *to) /* Fast path */ to->readers = i; i->prev = (struct fib_iterator *) to; - fixup: - while (i && i->node) - { - i->node = NULL; - i = i->next; - } - return; } - /* Really merging */ - while (j->next) - j = j->next; - j->next = i; - i->prev = j; - goto fixup; + else + { + /* Really merging */ + while (j->next) + j = j->next; + j->next = i; + i->prev = j; + } + while (i && i->node) + { + i->node = NULL; + i = i->next; + } } else /* No more nodes */ while (i) @@ -260,7 +260,7 @@ fit_get(struct fib *f, struct fib_iterator *i) if (!i->prev) { /* We are at the end */ - i->hash = f->hash_size; + i->hash = ~0 - 1; return NULL; } if (!(n = i->node)) -- cgit v1.2.3