bool MapContainsSameKeys(const Map *map1, const Map *map2) { assert(map1 != NULL); assert(map2 != NULL); MapIterator i = MapIteratorInit((Map *)map1); MapKeyValue *item; size_t count = 0; while ((item = MapIteratorNext(&i))) { count++; if (!MapHasKey(map2, item->key)) { return false; } } return (count == MapSize(map2)); }
bool SetContains(const Set *set, const void *element) { return MapHasKey(set, element); }
bool SetContains(const Set *set, const void *element) { assert(set != NULL); return MapHasKey(set, element); }