ext/drcontainers/hashtable.c
/* Lookup an entry by key and return a pointer to the corresponding entry 
 * Returns NULL if no such entry exists */
Lookup an entry by key and return a pointer to the corresponding entry
Returns NULL if no such entry exists
Lookup an entry by key and return a pointer to the corresponding entry Returns NULL if no such entry exists
void *
hashtable_lookup(hashtable_t *table, void *key)
{
    void *res = NULL;
    hash_entry_t *e;
    uint hindex = hash_key(table, key);
    if (table->synch)
        dr_mutex_lock(table->lock);
    for (e = table->table[hindex]; e != NULL; e = e->next) {
        if (keys_equal(table, e->key, key)) {
            res = e->payload;
            break;
        }
    }
    if (table->synch)
        dr_mutex_unlock(table->lock);
    return res;
}
void * hashtable_lookup ( hashtable_t * table , void * key ) { void * res = NULL ; hash_entry_t * e ; uint hindex = hash_key ( table , key ) ; if ( table -> synch ) dr_mutex_lock ( table -> lock ) ; for ( e = table -> table [ hindex ] ; e != NULL ; e = e -> next ) { if ( keys_equal ( table , e -> key , key ) ) { res = e -> payload ; break ; } } if ( table -> synch ) dr_mutex_unlock ( table -> lock ) ; return res ; }
Lookup an entry by key and return a pointer to the corresponding entry
 Returns NULL if no such entry exists
Lookup an entry by key and return a pointer to the corresponding entry Returns NULL if no such entry exists