Skip to content

Commit

Permalink
py/pairheap: Add helper function to initialise a new node.
Browse files Browse the repository at this point in the history
  • Loading branch information
dpgeorge committed Mar 25, 2020
1 parent c47a3dd commit 6c7e78d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions py/pairheap.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ static inline mp_pairheap_t *mp_pairheap_new(mp_pairheap_lt_t lt) {
return NULL;
}

// Initialise a single pairing-heap node so it is ready to push on to a heap.
static inline void mp_pairheap_init_node(mp_pairheap_lt_t lt, mp_pairheap_t *node) {
(void)lt;
node->child = NULL;
node->next = NULL;
}

// Test if the heap is empty.
static inline bool mp_pairheap_is_empty(mp_pairheap_lt_t lt, mp_pairheap_t *heap) {
(void)lt;
Expand Down

0 comments on commit 6c7e78d

Please sign in to comment.