dovecot: Code cleanup

dovecot at dovecot.org dovecot at dovecot.org
Wed Jan 30 18:41:41 EET 2008


details:   http://hg.dovecot.org/dovecot/rev/c7f1cb8556be
changeset: 7200:c7f1cb8556be
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Jan 30 18:41:23 2008 +0200
description:
Code cleanup

diffstat:

1 file changed, 3 insertions(+), 5 deletions(-)
src/lib-storage/index/index-sort.c |    8 +++-----

diffs (19 lines):

diff -r 24266b9a6c55 -r c7f1cb8556be src/lib-storage/index/index-sort.c
--- a/src/lib-storage/index/index-sort.c	Wed Jan 30 18:06:46 2008 +0200
+++ b/src/lib-storage/index/index-sort.c	Wed Jan 30 18:41:23 2008 +0200
@@ -345,12 +345,10 @@ index_sort_add_ids_range(struct mail_sea
 	rightmost_idx = count - 1;
 
 	/* get the sort IDs from left and right */
-	i_assert(left_idx == 0 || nodes[left_idx].sort_id != 0);
-	i_assert(right_idx == rightmost_idx || nodes[right_idx].sort_id != 0);
-	left_sort_id = nodes[left_idx].sort_id == 0 ? 1 :
-		nodes[left_idx].sort_id;
-	right_sort_id = nodes[right_idx].sort_id == 0 ? (uint32_t)-1 :
+	left_sort_id = left_idx == 0 ? 1 : nodes[left_idx].sort_id;
+	right_sort_id = right_idx == rightmost_idx ? (uint32_t)-1 :
 		nodes[right_idx].sort_id;
+	i_assert(left_sort_id != 0 && right_sort_id != 0);
 
 	while ((right_sort_id - left_sort_id) / (right_idx-left_idx + 2) == 0) {
 		/* we most likely don't have enough space. we have to


More information about the dovecot-cvs mailing list