changeset 11173:cf88ac9665f7 HEAD

mdbox: Minor optimization for syncing expunges.
author Timo Sirainen <tss@iki.fi>
date Mon, 19 Apr 2010 16:36:42 +0300
parents 4ee1d2312d83
children 422ab02950b7
files src/lib-storage/index/dbox-multi/mdbox-sync.c
diffstat 1 files changed, 1 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/dbox-multi/mdbox-sync.c	Mon Apr 19 16:35:36 2010 +0300
+++ b/src/lib-storage/index/dbox-multi/mdbox-sync.c	Mon Apr 19 16:36:42 2010 +0300
@@ -26,8 +26,6 @@
 #include <stdlib.h>
 #include <dirent.h>
 
-#define DBOX_REBUILD_COUNT 3
-
 static int
 dbox_sync_verify_expunge_guid(struct mdbox_sync_context *ctx, uint32_t seq,
 			      const uint8_t guid_128[MAIL_GUID_128_SIZE])
@@ -56,20 +54,17 @@
 {
 	uint32_t map_uid;
 
-	if (seq_range_exists(&ctx->expunged_seqs, seq)) {
+	if (seq_range_array_add(&ctx->expunged_seqs, 0, seq)) {
 		/* already marked as expunged in this sync */
 		return 0;
 	}
 
 	if (dbox_sync_verify_expunge_guid(ctx, seq, guid_128) < 0)
 		return -1;
-
 	if (mdbox_mail_lookup(ctx->mbox, ctx->sync_view, seq, &map_uid) < 0)
 		return -1;
-
 	if (dbox_map_update_refcount(ctx->map_trans, map_uid, -1) < 0)
 		return -1;
-	seq_range_array_add(&ctx->expunged_seqs, 0, seq);
 	return 0;
 }