Ejemplo n.º 1
0
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));
}
Ejemplo n.º 2
0
bool SetContains(const Set *set, const void *element)
{
    return MapHasKey(set, element);
}
Ejemplo n.º 3
0
Archivo: set.c Proyecto: cfengine/core
bool SetContains(const Set *set, const void *element)
{
    assert(set != NULL);
    return MapHasKey(set, element);
}