use TAILQ_CONCAT in filterset_move(). ok claudio@
authorbenno <benno@openbsd.org>
Sun, 9 Sep 2018 14:08:11 +0000 (14:08 +0000)
committerbenno <benno@openbsd.org>
Sun, 9 Sep 2018 14:08:11 +0000 (14:08 +0000)
usr.sbin/bgpd/rde_filter.c

index 04d7f13..39db8a9 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: rde_filter.c,v 1.105 2018/09/08 15:25:27 benno Exp $ */
+/*     $OpenBSD: rde_filter.c,v 1.106 2018/09/09 14:08:11 benno Exp $ */
 
 /*
  * Copyright (c) 2004 Claudio Jeker <claudio@openbsd.org>
@@ -756,17 +756,10 @@ filterset_cmp(struct filter_set *a, struct filter_set *b)
 void
 filterset_move(struct filter_set_head *source, struct filter_set_head *dest)
 {
-       struct filter_set       *s;
-
        TAILQ_INIT(dest);
-
        if (source == NULL)
                return;
-
-       while ((s = TAILQ_FIRST(source)) != NULL) {
-               TAILQ_REMOVE(source, s, entry);
-               TAILQ_INSERT_TAIL(dest, s, entry);
-       }
+       TAILQ_CONCAT(dest, source, entry);
 }
 
 int