summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ldapd
diff options
context:
space:
mode:
authorbket <bket@openbsd.org>2020-01-28 15:51:26 +0000
committerbket <bket@openbsd.org>2020-01-28 15:51:26 +0000
commit2c0cf13df2fb74115d0ef411ecd0c44b5b1736a5 (patch)
treeb5183cce213579c80c51b459997f8b62559a2c98 /usr.sbin/ldapd
parentusr.sbin/bgpd: replace TAILQ concatenation loop with TAILQ_CONCAT (diff)
downloadwireguard-openbsd-2c0cf13df2fb74115d0ef411ecd0c44b5b1736a5.tar.xz
wireguard-openbsd-2c0cf13df2fb74115d0ef411ecd0c44b5b1736a5.zip
usr.sbin/ldapd: replace TAILQ concatenation loop with TAILQ_CONCAT
OK florian@
Diffstat (limited to 'usr.sbin/ldapd')
-rw-r--r--usr.sbin/ldapd/search.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/usr.sbin/ldapd/search.c b/usr.sbin/ldapd/search.c
index 3033823eb18..481c815cf4c 100644
--- a/usr.sbin/ldapd/search.c
+++ b/usr.sbin/ldapd/search.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: search.c,v 1.25 2019/10/24 12:39:26 tb Exp $ */
+/* $OpenBSD: search.c,v 1.26 2020/01/28 15:51:26 bket Exp $ */
/*
* Copyright (c) 2009, 2010 Martin Hedenfalk <martin@bzero.se>
@@ -764,11 +764,8 @@ search_planner(struct namespace *ns, struct ber_element *filter)
/* Select an index to use. */
TAILQ_FOREACH(arg, &plan->args, next) {
if (arg->indexed) {
- while ((indx = TAILQ_FIRST(&arg->indices))) {
- TAILQ_REMOVE(&arg->indices, indx, next);
- TAILQ_INSERT_TAIL(&plan->indices, indx,
- next);
- }
+ TAILQ_CONCAT(&plan->indices, &arg->indices,
+ next);
plan->indexed = arg->indexed;
break;
}
@@ -796,11 +793,9 @@ search_planner(struct namespace *ns, struct ber_element *filter)
plan->indexed = 0;
break;
}
- while ((indx = TAILQ_FIRST(&arg->indices))) {
- TAILQ_REMOVE(&arg->indices, indx, next);
- TAILQ_INSERT_TAIL(&plan->indices, indx,next);
+ TAILQ_FOREACH(indx, &arg->indices, next)
plan->indexed++;
- }
+ TAILQ_CONCAT(&plan->indices, &arg->indices, next);
}
break;
case LDAP_FILT_NOT: