]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Cleanup - Don't use ctx in iter_use_index()
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 29 May 2017 13:44:44 +0000 (16:44 +0300)
committerGitLab <gitlab@git.dovecot.net>
Tue, 30 May 2017 07:00:34 +0000 (10:00 +0300)
Shrinks the following change.

src/lib-storage/list/mailbox-list-index-iter.c

index 2c7322244cbd4bc4c0ef6bf30ee97279abfb34df..ec05c4f6b5003918b7589ccc73d1d7bc6c126790 100644 (file)
@@ -7,22 +7,23 @@
 #include "mailbox-list-subscriptions.h"
 #include "mailbox-list-index.h"
 
-static bool iter_use_index(struct mailbox_list_index_iterate_context *ctx)
+static bool iter_use_index(struct mailbox_list *list,
+                          enum mailbox_list_iter_flags flags)
 {
-       struct mailbox_list_index *ilist = INDEX_LIST_CONTEXT(ctx->ctx.list);
+       struct mailbox_list_index *ilist = INDEX_LIST_CONTEXT(list);
 
-       if ((ctx->ctx.flags & MAILBOX_LIST_ITER_SELECT_SUBSCRIBED) != 0) {
+       if ((flags & MAILBOX_LIST_ITER_SELECT_SUBSCRIBED) != 0) {
                /* for now we don't use indexes when listing subscriptions,
                   because it needs to list also the nonexistent subscribed
                   mailboxes, which don't exist in the index. */
                return FALSE;
        }
-       if ((ctx->ctx.flags & MAILBOX_LIST_ITER_RAW_LIST) != 0 &&
+       if ((flags & MAILBOX_LIST_ITER_RAW_LIST) != 0 &&
            ilist->has_backing_store) {
                /* no indexing wanted with raw lists */
                return FALSE;
        }
-       if (mailbox_list_index_refresh(ctx->ctx.list) < 0 &&
+       if (mailbox_list_index_refresh(list) < 0 &&
            ilist->has_backing_store) {
                /* refresh failed */
                return FALSE;
@@ -49,7 +50,7 @@ mailbox_list_index_iter_init(struct mailbox_list *list,
        array_create(&ctx->ctx.module_contexts, pool, sizeof(void *), 5);
        ctx->info_pool = pool_alloconly_create("mailbox list index iter info", 128);
 
-       if (!iter_use_index(ctx)) {
+       if (!iter_use_index(list, flags)) {
                /* no indexing */
                ctx->backend_ctx = ilist->module_ctx.super.
                        iter_init(list, patterns, flags);