/*---------------------------------------------------------------------- * 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; }
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; }