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

Function listRotateTailToHead

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

Rotate the list removing the tail node and inserting it to the head. */

Source from the content-addressed store, hash-verified

329
330/* Rotate the list removing the tail node and inserting it to the head. */
331void listRotateTailToHead(list *list) {
332 if (listLength(list) <= 1) return;
333
334 /* Detach current tail */
335 listNode *tail = list->tail;
336 list->tail = tail->prev;
337 list->tail->next = NULL;
338 /* Move it as head */
339 list->head->prev = tail;
340 tail->prev = NULL;
341 tail->next = list->head;
342 list->head = tail;
343}
344
345/* Rotate the list removing the head node and inserting it to the tail. */
346void listRotateHeadToTail(list *list) {

Callers 1

clientsCronFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected