lib/cmap.c
/* Searches 'cmap' for an element with the specified 'hash'.  If one or more is
 * found, returns a pointer to the first one, otherwise a null pointer.  All of
 * the nodes on the returned list are guaranteed to have exactly the given
 * 'hash'.
 *
 * This function works even if 'cmap' is changing concurrently.  If 'cmap' is
 * not changing, then cmap_find_protected() is slightly faster.
 *
 * CMAP_FOR_EACH_WITH_HASH is usually more convenient. */
Searches 'cmap' for an element with the specified 'hash'.  If one or more is
found, returns a pointer to the first one, otherwise a null pointer.  All of
the nodes on the returned list are guaranteed to have exactly the given
'hash'.

This function works even if 'cmap' is changing concurrently.  If 'cmap' is
not changing, then cmap_find_protected() is slightly faster.

CMAP_FOR_EACH_WITH_HASH is usually more convenient.
Searches ' cmap ' for an element with the specified ' hash ' . If one or more is found returns a pointer to the first one otherwise a null pointer . All of the nodes on the returned list are guaranteed to have exactly the given ' hash ' . This function works even if ' cmap ' is changing concurrently . If ' cmap ' is not changing then cmap_find_protected () is slightly faster . CMAP_FOR_EACH_WITH_HASH is usually more convenient .
const struct cmap_node *
cmap_find(const struct cmap *cmap, uint32_t hash)
{
    const struct cmap_impl *impl = cmap_get_impl(cmap);
    uint32_t h1 = rehash(impl, hash);
    uint32_t h2 = other_hash(h1);
    return cmap_find__(&impl->buckets[h1 & impl->mask],
                       &impl->buckets[h2 & impl->mask],
                       hash);
}
const struct cmap_node * cmap_find ( const struct cmap * cmap , uint32_t hash ) { const struct cmap_impl * impl = cmap_get_impl ( cmap ) ; uint32_t h1 = rehash ( impl , hash ) ; uint32_t h2 = other_hash ( h1 ) ; return cmap_find__ ( & impl -> buckets [ h1 & impl -> mask ] , & impl -> buckets [ h2 & impl -> mask ] , hash ) ; }
Searches 'cmap' for an element with the specified 'hash'.
Searches ' cmap ' for an element with the specified ' hash ' .