[dovecot-cvs] dovecot/src/imap imap-thread.c,1.20,1.21

tss-movial at dovecot.org tss-movial at dovecot.org
Mon May 15 12:47:36 EEST 2006


Update of /var/lib/cvs/dovecot/src/imap
In directory talvi:/tmp/cvs-serv25873

Modified Files:
	imap-thread.c 
Log Message:
Minor cleanup / memory reducement fix



Index: imap-thread.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/imap-thread.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- imap-thread.c	14 Jan 2006 18:47:21 -0000	1.20
+++ imap-thread.c	15 May 2006 09:47:34 -0000	1.21
@@ -353,6 +353,11 @@
 		}
 	}
 
+	if (child->parent->parent == NULL) {
+		/* unlinking from root */
+		ctx->root_count--;
+	}
+
 	child->next = NULL;
 	if (!add_to_root)
 		child->parent = NULL;
@@ -414,8 +419,7 @@
 }
 
 static void link_message(struct thread_context *ctx,
-			 const char *parent_msgid, const char *child_msgid,
-			 bool replace)
+			 const char *parent_msgid, const char *child_msgid)
 {
 	struct node *child;
 
@@ -423,7 +427,7 @@
 	if (child == NULL)
 		child = create_node(ctx, child_msgid);
 
-	link_node(ctx, parent_msgid, child, replace);
+	link_node(ctx, parent_msgid, child, FALSE);
 }
 
 static bool link_references(struct thread_context *ctx,
@@ -436,7 +440,7 @@
 		return FALSE;
 
 	while ((child_id = get_msgid(&references)) != NULL) {
-		link_message(ctx, parent_id, child_id, FALSE);
+		link_message(ctx, parent_id, child_id);
 		parent_id = child_id;
 	}
 
@@ -471,7 +475,7 @@
 			link_node(ctx, refid, node, TRUE);
 		else {
 			/* no references, make sure it's not linked */
-			if (node != NULL && NODE_HAS_PARENT(ctx, node))
+			if (NODE_HAS_PARENT(ctx, node))
 				unlink_child(ctx, node, TRUE);
 		}
 	}



More information about the dovecot-cvs mailing list