This is the final step before the actual optimisation of the memmoves.
HACK, as it it de-optimises the moves so as much as possible gets moved
as many times as possible. It clears the path for a later patch which
optimises them far better.
Based on draft patch by Timo Sirainen.
Signed-off-by: Phil Carmody <phil@dovecot.fi>
}
}
- /* do this in reverse so the memmove()s are smaller */
- for (i = count; i > 0; i--) {
- uint32_t seq1 = range[i-1].seq1;
- uint32_t seq2 = range[i-1].seq2;
+ /* Preparatory HACK - do this in forward order so the memmove()s are pessimal! */
+ for (i = 0; i < count; i++) {
+ uint32_t seq1 = range[i].seq1;
+ uint32_t seq2 = range[i].seq2;
struct mail_index_record *rec;
uint32_t seq_count, seq;