コード例 #1
0
ファイル: map.c プロジェクト: salewski/cfengine-core
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));
}
コード例 #2
0
ファイル: set.c プロジェクト: chrishiestand/core
bool SetContains(const Set *set, const void *element)
{
    return MapHasKey(set, element);
}
コード例 #3
0
ファイル: set.c プロジェクト: cfengine/core
bool SetContains(const Set *set, const void *element)
{
    assert(set != NULL);
    return MapHasKey(set, element);
}