~ubuntu-branches/ubuntu/wily/dovecot/wily

« back to all changes in this revision

Viewing changes to src/lib-storage/index/index-thread.c

  • Committer: Package Import Robot
  • Author(s): Jaldhar H. Vyas
  • Date: 2013-09-09 00:57:32 UTC
  • mfrom: (1.13.11)
  • mto: (4.8.5 experimental) (1.16.1)
  • mto: This revision was merged to the branch mainline in revision 97.
  • Revision ID: package-import@ubuntu.com-20130909005732-dn1eell8srqbhh0e
Tags: upstream-2.2.5
ImportĀ upstreamĀ versionĀ 2.2.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2002-2012 Dovecot authors, see the included COPYING file */
 
1
/* Copyright (c) 2002-2013 Dovecot authors, see the included COPYING file */
2
2
 
3
3
/* doc/thread-refs.txt describes the incremental algorithm we use here. */
4
4
 
352
352
        return ret;
353
353
}
354
354
 
355
 
static int msgid_map_cmp(const void *key, const void *value)
 
355
static int msgid_map_cmp(const uint32_t *uid,
 
356
                         const struct mail_index_strmap_rec *rec)
356
357
{
357
 
        const uint32_t *uid = key;
358
 
        const struct mail_index_strmap_rec *rec = value;
359
 
 
360
358
        return *uid < rec->uid ? -1 :
361
359
                (*uid > rec->uid ? 1 : 0);
362
360
}
387
385
        uids = array_get(&removed_uids, &uid_count);
388
386
        for (i = j = 0; i < uid_count; i++) {
389
387
                /* find and remove from the map */
390
 
                bsearch_insert_pos(&uids[i].seq1, &msgid_map[j], map_count - j,
391
 
                                   sizeof(*msgid_map), msgid_map_cmp, &idx);
 
388
                bsearch_insert_pos(&uids[i].seq1, &msgid_map[j],
 
389
                                   map_count - j, sizeof(*msgid_map),
 
390
                                   msgid_map_cmp, &idx);
392
391
                j += idx;
393
392
                if (j == map_count) {
394
393
                        /* all removals after this are about messages we never