Bj??rn Ketelaars([email protected]) on 2020.01.27 20:52:36 +0100:
> Replace custom TAILQ concatenation loop by TAILQ_CONCAT(3).
>
> Comments/OK?
reads ok benno@
> diff --git sbin/unwind/frontend.c sbin/unwind/frontend.c
> index b64036c4332..d2b69084db7 100644
> --- sbin/unwind/frontend.c
> +++ sbin/unwind/frontend.c
> @@ -1011,10 +1011,7 @@ merge_tas(struct trust_anchor_head *newh, struct
> trust_anchor_head *oldh)
>
> if (chg) {
> free_tas(oldh);
> - while((i = TAILQ_FIRST(newh)) != NULL) {
> - TAILQ_REMOVE(newh, i, entry);
> - TAILQ_INSERT_TAIL(oldh, i, entry);
> - }
> + TAILQ_CONCAT(oldh, newh, entry);
> } else {
> free_tas(newh);
> }
> diff --git sbin/unwind/resolver.c sbin/unwind/resolver.c
> index 15d2c90b1e8..c12bdbdab26 100644
> --- sbin/unwind/resolver.c
> +++ sbin/unwind/resolver.c
> @@ -1650,10 +1650,7 @@ replace_forwarders(struct uw_forwarder_head *new_list,
> struct
> free(uw_forwarder);
> }
>
> - while ((uw_forwarder = TAILQ_FIRST(new_list)) != NULL) {
> - TAILQ_REMOVE(new_list, uw_forwarder, entry);
> - TAILQ_INSERT_TAIL(old_list, uw_forwarder, entry);
> - }
> + TAILQ_CONCAT(old_list, new_list, entry);
> }
>
> int
>