MCPcopy Create free account
hub / github.com/apache/cloudberry / dlist_move_tail

Function dlist_move_tail

src/include/lib/ilist.h:403–414  ·  view source on GitHub ↗

* Move element from its current position in the list to the tail position in * the same list. * * Undefined behaviour if 'node' is not already part of the list. */

Source from the content-addressed store, hash-verified

401 * Undefined behaviour if 'node' is not already part of the list.
402 */
403static inline void
404dlist_move_tail(dlist_head *head, dlist_node *node)
405{
406 /* fast path if it's already at the tail */
407 if (head->head.prev == node)
408 return;
409
410 dlist_delete(node);
411 dlist_push_tail(head, node);
412
413 dlist_check(head);
414}
415
416/*
417 * Check whether 'node' has a following node.

Callers 1

cache_lookupFunction · 0.85

Calls 3

dlist_deleteFunction · 0.85
dlist_push_tailFunction · 0.85
dlist_checkFunction · 0.85

Tested by

no test coverage detected