Switch/ext/ebtree/ebtree.h
static inline struct eb_node *eb_next(struct eb_node *node)
{
	eb_troot_t *t = node->leaf_p;

	while (eb_gettag(t) != EB_LEFT)
		/* Walking up from right branch, so we cannot be below root */
		t = (eb_root_to_node(eb_untag(t, EB_RGHT)))->node_p;

	/* Note that <t> cannot be NULL at this stage */
	t = (eb_untag(t, EB_LEFT))->b[EB_RGHT];
	if (eb_clrtag(t) == NULL)
		return NULL;
	return eb_walk_down(t, EB_LEFT);
}
/* Return next leaf node after an existing leaf node, or NULL if none. */
Return next leaf node after an existing leaf node, or NULL if none.
Return next leaf node after an existing leaf node or NULL if none .
static inline struct eb_node *eb_next(struct eb_node *node)
{
	eb_troot_t *t = node->leaf_p;
	while (eb_gettag(t) != EB_LEFT)
		t = (eb_root_to_node(eb_untag(t, EB_RGHT)))->node_p;
	t = (eb_untag(t, EB_LEFT))->b[EB_RGHT];
	if (eb_clrtag(t) == NULL)
		return NULL;
	return eb_walk_down(t, EB_LEFT);
}
static inline struct eb_node * eb_next ( struct eb_node * node ) { eb_troot_t * t = node -> leaf_p ; while ( eb_gettag ( t ) != EB_LEFT ) t = ( eb_root_to_node ( eb_untag ( t , EB_RGHT ) ) ) -> node_p ; t = ( eb_untag ( t , EB_LEFT ) ) -> b [ EB_RGHT ] ; if ( eb_clrtag ( t ) == NULL ) return NULL ; return eb_walk_down ( t , EB_LEFT ) ; }
Return next leaf node after an existing leaf node, or NULL if none.
Return next leaf node after an existing leaf node or NULL if none .
/* Walking up from right branch, so we cannot be below root */ /* Note that <t> cannot be NULL at this stage */