dovecot-2.0: layout=maildir++: Minor code cleanup.

dovecot at dovecot.org dovecot at dovecot.org
Mon Apr 5 01:22:26 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/2a4a4140c999
changeset: 11044:2a4a4140c999
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Apr 05 01:22:23 2010 +0300
description:
layout=maildir++: Minor code cleanup.

diffstat:

 src/lib-storage/list/mailbox-list-maildir-iter.c |  23 ++++++++++++-----------
 1 files changed, 12 insertions(+), 11 deletions(-)

diffs (34 lines):

diff -r 49fa7e735b87 -r 2a4a4140c999 src/lib-storage/list/mailbox-list-maildir-iter.c
--- a/src/lib-storage/list/mailbox-list-maildir-iter.c	Mon Apr 05 01:18:51 2010 +0300
+++ b/src/lib-storage/list/mailbox-list-maildir-iter.c	Mon Apr 05 01:22:23 2010 +0300
@@ -147,18 +147,19 @@
 			update_only = TRUE;
 	}
 
-	created = FALSE;
-	node = update_only ?
-		mailbox_tree_lookup(ctx->tree_ctx, "INBOX") :
-		mailbox_tree_get(ctx->tree_ctx, "INBOX", &created);
-	if (created)
-		node->flags = MAILBOX_NOCHILDREN;
-	else if (node != NULL)
-		node->flags &= ~MAILBOX_NONEXISTENT;
+	if (update_only) {
+		node = mailbox_tree_lookup(ctx->tree_ctx, "INBOX");
+		if (node != NULL)
+			node->flags &= ~MAILBOX_NONEXISTENT;
+	} else {
+		node = mailbox_tree_get(ctx->tree_ctx, "INBOX", &created);
+		if (created)
+			node->flags = MAILBOX_NOCHILDREN;
+		else
+			node->flags &= ~MAILBOX_NONEXISTENT;
 
-	match = imap_match(glob, "INBOX");
-	if ((match & (IMAP_MATCH_YES | IMAP_MATCH_PARENT)) != 0) {
-		if (!update_only)
+		match = imap_match(glob, "INBOX");
+		if ((match & (IMAP_MATCH_YES | IMAP_MATCH_PARENT)) != 0)
 			node->flags |= MAILBOX_MATCHED;
 	}
 	return 0;


More information about the dovecot-cvs mailing list