util: rewrite dlinklist.h so that DLIST_ADD_END() is O(1)
[abartlet/samba.git/.git] / source4 / dsdb / samdb / ldb_modules / repl_meta_data.c
index e64d51aad0c22b2313a325f9d689c4bc510b7a0a..67d7094d4c890e7c9bc8f8889b0b2b628c51727d 100644 (file)
@@ -3783,8 +3783,7 @@ static int replmd_prepare_commit(struct ldb_module *module)
        /* walk the list backwards, to do the first entry first, as we
         * added the entries with DLIST_ADD() which puts them at the
         * start of the list */
-       DLIST_TAIL(replmd_private->la_list,la);
-       for (; la; la=prev) {
+       for (la = DLIST_TAIL(replmd_private->la_list); la; la=prev) {
                prev = DLIST_PREV(la);
                DLIST_REMOVE(replmd_private->la_list, la);
                ret = replmd_process_linked_attribute(module, la);