mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2025-03-22 06:17:04 +00:00
FIB walk macros now allow continue from the loop
This commit is contained in:
parent
1c0bc707a0
commit
4e9725e825
11
lib/fib.h
11
lib/fib.h
@ -94,17 +94,16 @@ void fit_copy(struct fib *f, struct fib_iterator *dst, struct fib_iterator *src)
|
|||||||
uint count_ = (fib)->hash_size; \
|
uint count_ = (fib)->hash_size; \
|
||||||
uint hpos_ = (it)->hash; \
|
uint hpos_ = (it)->hash; \
|
||||||
type *z; \
|
type *z; \
|
||||||
for(;;) { \
|
for(;;fn_ = fn_->next) { \
|
||||||
if (!fn_) \
|
while (!fn_ && ++hpos_ < count_) \
|
||||||
{ \
|
{ \
|
||||||
if (++hpos_ >= count_) \
|
|
||||||
break; \
|
|
||||||
fn_ = (fib)->hash_table[hpos_]; \
|
fn_ = (fib)->hash_table[hpos_]; \
|
||||||
continue; \
|
|
||||||
} \
|
} \
|
||||||
|
if (hpos_ >= count_) \
|
||||||
|
break; \
|
||||||
z = fib_node_to_user(fib, fn_);
|
z = fib_node_to_user(fib, fn_);
|
||||||
|
|
||||||
#define FIB_ITERATE_END fn_ = fn_->next; } } while(0)
|
#define FIB_ITERATE_END } } while(0)
|
||||||
|
|
||||||
#define FIB_ITERATE_PUT(it) fit_put(it, fn_)
|
#define FIB_ITERATE_PUT(it) fit_put(it, fn_)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user