Mercurial > dovecot > original-hg > dovecot-1.2
changeset 7200:c7f1cb8556be HEAD
Code cleanup
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Wed, 30 Jan 2008 18:41:23 +0200 |
parents | 24266b9a6c55 |
children | 52639b885d87 |
files | src/lib-storage/index/index-sort.c |
diffstat | 1 files changed, 3 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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 @@ 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