Add all the elements of the list 'o' at the end of the * list 'l'. The list 'other' remains empty but otherwise valid. */
| 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. */ |
| 362 | void 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 | } |
no outgoing calls
no test coverage detected