0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-23 02:01:55 +00:00

Removed unnecessary recursion from rt_export_get()

This commit is contained in:
Maria Matejka 2024-06-12 11:33:26 +02:00
parent 76a1998ff5
commit 0e42398304

View File

@ -49,13 +49,14 @@ rt_export_get(struct rt_export_request *r)
.feed = feed, \ .feed = feed, \
}; \ }; \
return (r->cur = reu); \ return (r->cur = reu); \
} while (0) \ } while (0)
#define NOT_THIS_UPDATE do { \ #define NOT_THIS_UPDATE \
lfjour_release(&r->r); \ lfjour_release(&r->r); \
return rt_export_get(r); \ continue;
} while (0) \
while (1)
{
enum rt_export_state es = rt_export_get_state(r); enum rt_export_state es = rt_export_get_state(r);
switch (es) switch (es)
{ {
@ -92,6 +93,7 @@ rt_export_get(struct rt_export_request *r)
/* No update, try feed */ /* No update, try feed */
if (!update) if (!update)
{
if (es == TES_READY) if (es == TES_READY)
{ {
/* Fed up of feeding */ /* Fed up of feeding */
@ -120,6 +122,7 @@ rt_export_get(struct rt_export_request *r)
CALL(r->fed, r); CALL(r->fed, r);
return NULL; return NULL;
} }
}
/* There actually is an update */ /* There actually is an update */
if (bmap_test(&r->seq_map, update->seq)) if (bmap_test(&r->seq_map, update->seq))
@ -165,6 +168,7 @@ rt_export_get(struct rt_export_request *r)
rtex_trace(r, D_ROUTES, "Updating %N, seq %lu", n, update->seq); rtex_trace(r, D_ROUTES, "Updating %N, seq %lu", n, update->seq);
EXPORT_FOUND(RT_EXPORT_UPDATE); EXPORT_FOUND(RT_EXPORT_UPDATE);
}
#undef NOT_THIS_UPDATE #undef NOT_THIS_UPDATE
#undef EXPORT_FOUND #undef EXPORT_FOUND