dovecot-2.2: mail-index: use _REC_AT_SEQ not _MAP_IDX in backwar...

dovecot at dovecot.org dovecot at dovecot.org
Mon Jun 2 11:53:56 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/b579e315d9a8
changeset: 17431:b579e315d9a8
user:      Phil Carmody <phil at dovecot.fi>
date:      Mon Jun 02 14:50:34 2014 +0300
description:
mail-index: use _REC_AT_SEQ not _MAP_IDX in backward loops
[seq-1 .. 0] becomes [seq .. 1]

Don't pre-decrement, and terminate before you process seq=0.

Signed-off-by: Phil Carmody <phil at dovecot.fi>

diffstat:

 src/lib-index/mail-index-view.c |  5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diffs (17 lines):

diff -r d3564b417e77 -r b579e315d9a8 src/lib-index/mail-index-view.c
--- a/src/lib-index/mail-index-view.c	Mon Jun 02 14:50:34 2014 +0300
+++ b/src/lib-index/mail-index-view.c	Mon Jun 02 14:50:34 2014 +0300
@@ -215,11 +215,10 @@
 
 	map = view->index->map;
 	do {
-		seq--;
-		head_rec = MAIL_INDEX_MAP_IDX(map, seq);
+		head_rec = MAIL_INDEX_REC_AT_SEQ(map, seq);
 		if (head_rec->uid <= rec->uid)
 			break;
-	} while (seq > 0);
+	} while (--seq > 0);
 
 	if (head_rec->uid == rec->uid) {
 		/* found it. use it. reference the index mapping so that the


More information about the dovecot-cvs mailing list