src/adlist.c
void listJoin(list *l, list *o) {
    if (o->head)
        o->head->prev = l->tail;

    if (l->tail)
        l->tail->next = o->head;
    else
        l->head = o->head;

    if (o->tail) l->tail = o->tail;
    l->len += o->len;

    /* Setup other as an empty list. */
    o->head = o->tail = NULL;
    o->len = 0;
}
/* Add all the elements of the list 'o' at the end of the
 * list 'l'. The list 'other' remains empty but otherwise valid. */
Add all the elements of the list 'o' at the end of the
list 'l'. The list 'other' remains empty but otherwise valid.
Add all the elements of the list ' o ' at the end of the list ' l ' . The list ' other ' remains empty but otherwise valid .
void listJoin(list *l, list *o) {
    if (o->head)
        o->head->prev = l->tail;
    if (l->tail)
        l->tail->next = o->head;
    else
        l->head = o->head;
    if (o->tail) l->tail = o->tail;
    l->len += o->len;
    o->head = o->tail = NULL;
    o->len = 0;
}
void listJoin ( list * l , list * o ) { if ( o -> head ) o -> head -> prev = l -> tail ; if ( l -> tail ) l -> tail -> next = o -> head ; else l -> head = o -> head ; if ( o -> tail ) l -> tail = o -> tail ; l -> len += o -> len ; o -> head = o -> tail = NULL ; o -> len = 0 ; }
Add all the elements of the list 'o' at the end of the
 list 'l'.
Add all the elements of the list ' o ' at the end of the list ' l ' .
/* Setup other as an empty list. */