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

Function slist_delete_current

src/include/lib/ilist.h:670–685  ·  view source on GitHub ↗

* Delete the list element the iterator currently points to. * * Caution: this modifies iter->cur, so don't use that again in the current * loop iteration. */

Source from the content-addressed store, hash-verified

668 * loop iteration.
669 */
670static inline void
671slist_delete_current(slist_mutable_iter *iter)
672{
673 /*
674 * Update previous element's forward link. If the iteration is at the
675 * first list element, iter->prev will point to the list header's "head"
676 * field, so we don't need a special case for that.
677 */
678 iter->prev->next = iter->next;
679
680 /*
681 * Reset cur to prev, so that prev will continue to point to the prior
682 * valid list element after slist_foreach_modify() advances to the next.
683 */
684 iter->cur = iter->prev;
685}
686
687/*
688 * Return the containing struct of 'type' where 'membername' is the slist_node

Callers 4

cancel_on_dsm_detachFunction · 0.85
ForgetBackgroundWorkerFunction · 0.85
AtEOSubXact_SPIFunction · 0.85
SPI_freetuptableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected