MCPcopy Create free account
hub / github.com/MailCore/mailcore2 / splitSet

Function splitSet

src/core/imap/MCIMAPSession.cpp:296–328  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

294}
295
296static clist * splitSet(struct mailimap_set * set, unsigned int splitCount)
297{
298 struct mailimap_set * current_set;
299 clist * result;
300 unsigned int count;
301
302 result = clist_new();
303
304 current_set = NULL;
305 count = 0;
306 for(clistiter * iter = clist_begin(set->set_list) ; iter != NULL ; iter = clist_next(iter)) {
307 struct mailimap_set_item * item;
308
309 if (current_set == NULL) {
310 current_set = mailimap_set_new_empty();
311 }
312
313 item = (struct mailimap_set_item *) clist_content(iter);
314 mailimap_set_add_interval(current_set, item->set_first, item->set_last);
315 count ++;
316
317 if (count >= splitCount) {
318 clist_append(result, current_set);
319 current_set = NULL;
320 count = 0;
321 }
322 }
323 if (current_set != NULL) {
324 clist_append(result, current_set);
325 }
326
327 return result;
328}
329
330static struct mailimap_set * setFromIndexSet(IndexSet * indexSet)
331{

Callers 4

copyMessagesMethod · 0.85
moveMessagesMethod · 0.85
storeLabelsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected