Beispiel #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;
}
Beispiel #2
0
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;
}