dovecot-2.0-sslstream: lib-index: Don't refresh index after tran...

dovecot at dovecot.org dovecot at dovecot.org
Sat Feb 13 02:55:58 EET 2010


details:   http://hg.dovecot.org/dovecot-2.0-sslstream/rev/a5e545002bf5
changeset: 10245:a5e545002bf5
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Nov 02 18:02:48 2009 -0500
description:
lib-index: Don't refresh index after transaction commit if nothing was changed.

diffstat:

1 file changed, 4 insertions(+), 2 deletions(-)
src/lib-index/mail-index-transaction.c |    6 ++++--

diffs (28 lines):

diff -r 9c4740670030 -r a5e545002bf5 src/lib-index/mail-index-transaction.c
--- a/src/lib-index/mail-index-transaction.c	Mon Nov 02 13:39:54 2009 -0500
+++ b/src/lib-index/mail-index-transaction.c	Mon Nov 02 18:02:48 2009 -0500
@@ -158,12 +158,14 @@ static int mail_index_transaction_commit
 					   uoff_t *log_file_offset_r)
 {
 	struct mail_index *index = t->view->index;
+	bool changed;
 	int ret;
 
 	i_assert(t->first_new_seq >
 		 mail_index_view_get_messages_count(t->view));
 
-	if (!MAIL_INDEX_TRANSACTION_HAS_CHANGES(t) && !t->reset) {
+	changed = MAIL_INDEX_TRANSACTION_HAS_CHANGES(t) || t->reset;
+	if (!changed) {
 		/* nothing to append */
 		ret = 0;
 	} else {
@@ -172,7 +174,7 @@ static int mail_index_transaction_commit
 	mail_transaction_log_get_head(index->log, log_file_seq_r,
 				      log_file_offset_r);
 
-	if (ret == 0 && !index->syncing) {
+	if (ret == 0 && !index->syncing && changed) {
 		/* if we're committing a normal transaction, we want to
 		   have those changes in the index mapping immediately. this
 		   is especially important when committing cache offset


More information about the dovecot-cvs mailing list