dovecot-2.0: lib-index: Minor code cleanup / commenting.

dovecot at dovecot.org dovecot at dovecot.org
Tue Jul 6 15:57:58 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/0ffb55c4d323
changeset: 11738:0ffb55c4d323
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Jul 06 13:57:52 2010 +0100
description:
lib-index: Minor code cleanup / commenting.

diffstat:

 src/lib-index/mail-index-sync-update.c |  16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diffs (33 lines):

diff -r b9a5ad0324c8 -r 0ffb55c4d323 src/lib-index/mail-index-sync-update.c
--- a/src/lib-index/mail-index-sync-update.c	Tue Jul 06 13:44:48 2010 +0100
+++ b/src/lib-index/mail-index-sync-update.c	Tue Jul 06 13:57:52 2010 +0100
@@ -283,19 +283,23 @@
 {
 	struct mail_index_transaction_commit_result *result =
 		ctx->view->index->sync_commit_result;
-	uint32_t log_seq;
-	uoff_t log_offset, start_offset;
+	uint32_t prev_log_seq;
+	uoff_t prev_log_offset, trans_start_offset, trans_end_offset;
 
 	if (result == NULL)
 		return FALSE;
 
+	/* we'll return TRUE if this modseq change was written within the
+	   transaction that was just committed */
 	mail_transaction_log_view_get_prev_pos(ctx->view->log_view,
-					       &log_seq, &log_offset);
-	if (log_seq != result->log_file_seq)
+					       &prev_log_seq, &prev_log_offset);
+	if (prev_log_seq != result->log_file_seq)
 		return FALSE;
 
-	start_offset = result->log_file_offset - result->commit_size;
-	if (log_offset < start_offset || log_offset >= result->log_file_offset)
+	trans_end_offset = result->log_file_offset;
+	trans_start_offset = trans_end_offset - result->commit_size;
+	if (prev_log_offset < trans_start_offset ||
+	    prev_log_offset >= trans_end_offset)
 		return FALSE;
 
 	return TRUE;


More information about the dovecot-cvs mailing list