[dovecot-cvs] dovecot/src/lib-index mail-index-sync.c,1.32,1.33

cras at dovecot.org cras at dovecot.org
Fri Oct 8 20:06:20 EEST 2004


Update of /var/lib/cvs/dovecot/src/lib-index
In directory talvi:/tmp/cvs-serv9635/lib-index

Modified Files:
	mail-index-sync.c 
Log Message:
group multiple recent flag updates together



Index: mail-index-sync.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index-sync.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- mail-index-sync.c	4 Oct 2004 16:31:51 -0000	1.32
+++ mail-index-sync.c	8 Oct 2004 17:06:18 -0000	1.33
@@ -186,10 +186,23 @@
 		if (mail_index_lookup(ctx->view, seq, &rec) < 0)
 			return -1;
 
-		if ((rec->flags & MAIL_RECENT) == 0)
+		if ((rec->flags & MAIL_RECENT) == 0) {
+			if (update.uid1 != 0) {
+				mail_index_sync_sort_flags(ctx->updates_buf,
+							   &update,
+							   sizeof(update));
+				update.uid1 = 0;
+			}
 			continue;
+		}
 
-		update.uid1 = update.uid2 = rec->uid;
+		/* group updates together as much as possible */
+		if (update.uid1 == 0)
+			update.uid1 = rec->uid;
+                update.uid2 = rec->uid;
+	}
+
+	if (update.uid1 != 0) {
 		mail_index_sync_sort_flags(ctx->updates_buf,
 					   &update, sizeof(update));
 	}



More information about the dovecot-cvs mailing list