From: Timo Sirainen Date: Tue, 6 Jul 2010 12:57:52 +0000 (+0100) Subject: lib-index: Minor code cleanup / commenting. X-Git-Tag: 2.0.rc2~30 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1e2887ae909d9817cc43a7e40ecb50508419f7ed;p=thirdparty%2Fdovecot%2Fcore.git lib-index: Minor code cleanup / commenting. --HG-- branch : HEAD --- diff --git a/src/lib-index/mail-index-sync-update.c b/src/lib-index/mail-index-sync-update.c index 1a804f9332..3702995582 100644 --- a/src/lib-index/mail-index-sync-update.c +++ b/src/lib-index/mail-index-sync-update.c @@ -283,19 +283,23 @@ static bool sync_update_ignored_change(struct mail_index_sync_map_ctx *ctx) { 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;