MCPcopy Create free account
hub / github.com/F-Stack/f-stack / listJoin

Function listJoin

app/redis-6.2.6/src/adlist.c:362–378  ·  view source on GitHub ↗

Add all the elements of the list 'o' at the end of the * list 'l'. The list 'other' remains empty but otherwise valid. */

Source from the content-addressed store, hash-verified

360/* Add all the elements of the list 'o' at the end of the
361 * list 'l'. The list 'other' remains empty but otherwise valid. */
362void listJoin(list *l, list *o) {
363 if (o->len == 0) return;
364
365 o->head->prev = l->tail;
366
367 if (l->tail)
368 l->tail->next = o->head;
369 else
370 l->head = o->head;
371
372 l->tail = o->tail;
373 l->len += o->len;
374
375 /* Setup other as an empty list. */
376 o->head = o->tail = NULL;
377 o->len = 0;
378}

Callers 1

AddReplyFromClientFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected