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

	while (1) {
		if (eb_gettag(t) != EB_LEFT) {
			node = eb_root_to_node(eb_untag(t, EB_RGHT));
			/* if we're right and not in duplicates, stop here */
			if (node->bit >= 0)
				break;
			t = node->node_p;
		}
		else {
			/* 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, skipping duplicates,
 * or NULL if none. */
Return previous leaf node before an existing leaf node, skipping duplicates,
or NULL if none.
Return previous leaf node before an existing leaf node skipping duplicates or NULL if none .
static inline struct eb_node *eb_prev_unique(struct eb_node *node)
{
	eb_troot_t *t = node->leaf_p;
	while (1) {
		if (eb_gettag(t) != EB_LEFT) {
			node = eb_root_to_node(eb_untag(t, EB_RGHT));
			if (node->bit >= 0)
				break;
			t = node->node_p;
		}
		else {
			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_unique ( struct eb_node * node ) { eb_troot_t * t = node -> leaf_p ; while ( 1 ) { if ( eb_gettag ( t ) != EB_LEFT ) { node = eb_root_to_node ( eb_untag ( t , EB_RGHT ) ) ; if ( node -> bit >= 0 ) break ; t = node -> node_p ; } else { 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, skipping duplicates,
 or NULL if none.
Return previous leaf node before an existing leaf node skipping duplicates or NULL if none .
/* if we're right and not in duplicates, stop here */ /* Walking up from left branch. We must ensure that we never
			 * walk beyond root.
			 */ /* Note that <t> cannot be NULL at this stage */