Mercurial > dovecot > core-2.2
comparison src/lib-index/mail-index-transaction-sort-appends.c @ 15663:df2e46c38c92
lib-index: Fixed sorting appended messages when some were assigned new UIDs.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Mon, 21 Jan 2013 18:12:12 +0200 |
parents | d0d7b810646b |
children | 90710c6c3beb |
comparison
equal
deleted
inserted
replaced
15662:fc5c3281d6d3 | 15663:df2e46c38c92 |
---|---|
128 struct mail_index_record *recs, *sorted_recs; | 128 struct mail_index_record *recs, *sorted_recs; |
129 struct uid_map *new_uid_map; | 129 struct uid_map *new_uid_map; |
130 uint32_t *old_to_newseq_map; | 130 uint32_t *old_to_newseq_map; |
131 unsigned int i, count; | 131 unsigned int i, count; |
132 | 132 |
133 if (!t->appends_nonsorted || !array_is_created(&t->appends)) | 133 if (!array_is_created(&t->appends)) |
134 return; | 134 return; |
135 if (!t->appends_nonsorted) { | |
136 #ifdef DEBUG | |
137 recs = array_get_modifiable(&t->appends, &count); | |
138 i_assert(count > 0); | |
139 for (i = 1; i < count; i++) | |
140 i_assert(recs[i-1].uid < recs[i].uid); | |
141 #endif | |
142 return; | |
143 } | |
135 | 144 |
136 /* first make a copy of the UIDs and map them to sequences */ | 145 /* first make a copy of the UIDs and map them to sequences */ |
137 recs = array_get_modifiable(&t->appends, &count); | 146 recs = array_get_modifiable(&t->appends, &count); |
138 i_assert(count > 0); | 147 i_assert(count > 0); |
139 | 148 |