dovecot: Optimization: If FLAG_DROP_RECENT isn't set, don't both...

dovecot at dovecot.org dovecot at dovecot.org
Wed Jul 18 08:20:48 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/c5919ea0cb33
changeset: 6071:c5919ea0cb33
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Jul 18 08:18:56 2007 +0300
description:
Optimization: If FLAG_DROP_RECENT isn't set, don't bother calculating next_uid

diffstat:

1 file changed, 8 insertions(+), 6 deletions(-)
src/lib-index/mail-index-sync.c |   14 ++++++++------

diffs (24 lines):

diff -r bec0f5cc8388 -r c5919ea0cb33 src/lib-index/mail-index-sync.c
--- a/src/lib-index/mail-index-sync.c	Wed Jul 18 08:08:21 2007 +0300
+++ b/src/lib-index/mail-index-sync.c	Wed Jul 18 08:18:56 2007 +0300
@@ -587,12 +587,14 @@ int mail_index_sync_commit(struct mail_i
 		(void)mail_cache_compress(index->cache, ctx->ext_trans);
 	}
 
-	next_uid = mail_index_transaction_get_next_uid(ctx->ext_trans);
-	if ((ctx->flags & MAIL_INDEX_SYNC_FLAG_DROP_RECENT) != 0 &&
-	    index->map->hdr.first_recent_uid < next_uid) {
-		mail_index_update_header(ctx->ext_trans,
-			offsetof(struct mail_index_header, first_recent_uid),
-			&next_uid, sizeof(next_uid), FALSE);
+	if ((ctx->flags & MAIL_INDEX_SYNC_FLAG_DROP_RECENT) != 0) {
+		next_uid = mail_index_transaction_get_next_uid(ctx->ext_trans);
+		if (index->map->hdr.first_recent_uid < next_uid) {
+			mail_index_update_header(ctx->ext_trans,
+				offsetof(struct mail_index_header,
+					 first_recent_uid),
+				&next_uid, sizeof(next_uid), FALSE);
+		}
 	}
 
 	if (mail_index_transaction_commit(&ctx->ext_trans, &seq, &offset) < 0) {


More information about the dovecot-cvs mailing list