FreeBSD/sys/kern/subr_pctrie.c
/*
 * Returns the value stored at the index.  If the index is not present,
 * NULL is returned.
 */
Returns the value stored at the index.  If the index is not present,
NULL is returned.
Returns the value stored at the index . If the index is not present NULL is returned .
uint64_t *
pctrie_lookup(struct pctrie *ptree, uint64_t index)
{
	struct pctrie_node *node;
	uint64_t *m;
	int slot;
	node = pctrie_getroot(ptree);
	while (node != NULL) {
		if (pctrie_isleaf(node)) {
			m = pctrie_toval(node);
			if (*m == index)
				return (m);
			else
				break;
		} else if (pctrie_keybarr(node, index))
			break;
		slot = pctrie_slot(index, node->pn_clev);
		node = node->pn_child[slot];
	}
	return (NULL);
}
uint64_t * pctrie_lookup ( struct pctrie * ptree , uint64_t index ) { struct pctrie_node * node ; uint64_t * m ; int slot ; node = pctrie_getroot ( ptree ) ; while ( node != NULL ) { if ( pctrie_isleaf ( node ) ) { m = pctrie_toval ( node ) ; if ( * m == index ) return ( m ) ; else break ; } else if ( pctrie_keybarr ( node , index ) ) break ; slot = pctrie_slot ( index , node -> pn_clev ) ; node = node -> pn_child [ slot ] ; } return ( NULL ) ; }
Returns the value stored at the index.
Returns the value stored at the index .