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

	while (eb_gettag(t) == EB_LEFT) {
		/* Walking up from left branch. We must ensure that we never
		 * walk beyond root.
		 */
		if (unlikely(eb_clrtag((eb_untag(t, EB_LEFT))->b[EB_RGHT]) == NULL))
			return NULL;
		t = (eb_root_to_node(eb_untag(t, EB_LEFT)))->node_p;
	}
	/* Note that <t> cannot be NULL at this stage */
	t = (eb_untag(t, EB_RGHT))->b[EB_LEFT];
	return eb_walk_down(t, EB_RGHT);
}
/* Return previous leaf node before an existing leaf node, or NULL if none. */
Return previous leaf node before an existing leaf node, or NULL if none.
Return previous leaf node before an existing leaf node or NULL if none .
static inline struct eb_node *eb_prev(struct eb_node *node)
{
	eb_troot_t *t = node->leaf_p;
	while (eb_gettag(t) == EB_LEFT) {
		if (unlikely(eb_clrtag((eb_untag(t, EB_LEFT))->b[EB_RGHT]) == NULL))
			return NULL;
		t = (eb_root_to_node(eb_untag(t, EB_LEFT)))->node_p;
	}
	t = (eb_untag(t, EB_RGHT))->b[EB_LEFT];
	return eb_walk_down(t, EB_RGHT);
}
static inline struct eb_node * eb_prev ( struct eb_node * node ) { eb_troot_t * t = node -> leaf_p ; while ( eb_gettag ( t ) == EB_LEFT ) { if ( unlikely ( eb_clrtag ( ( eb_untag ( t , EB_LEFT ) ) -> b [ EB_RGHT ] ) == NULL ) ) return NULL ; t = ( eb_root_to_node ( eb_untag ( t , EB_LEFT ) ) ) -> node_p ; } t = ( eb_untag ( t , EB_RGHT ) ) -> b [ EB_LEFT ] ; return eb_walk_down ( t , EB_RGHT ) ; }
Return previous leaf node before an existing leaf node, or NULL if none.
Return previous leaf node before an existing leaf node or NULL if none .
/* Walking up from left branch. We must ensure that we never
		 * walk beyond root.
		 */ /* Note that <t> cannot be NULL at this stage */