예제 #1
0
/*----------------------------------------------------------------------
 * Get an element from the hash map.
 * Only the new element is stored in the map.
 * @param key Key of the element
 * @return The searched element or NULL if not found.
  -----------------------------------------------------------------------*/
ContainerElement HashMap_Get(HashMap map, const HashMapKey key)
{
  HashMapNode node = HashMap_Find(map, key);
  if (node)
    return node->elem;
  return NULL;
}
예제 #2
0
파일: preexec.c 프로젝트: HuaweiSwitch/OMI
static MI_Boolean _Contains(
    HashMap* self,
    const char* key)
{
    Bucket bucket;
    bucket.key = (char*)key;
    return HashMap_Find(self, (const HashBucket*)&bucket) ? MI_TRUE : MI_FALSE;
}