MapUniqueKeyCount
Description
Number of distinct keys stored in the multimap. Walks the slot table once to count canonical probe-anchor slots, so this is O(capacity) – prefer MapPairCount when total pair count is enough.
Parameters
| Name | Direction | Description |
|---|---|---|
m |
in | Map. |
Success
Returns the count of distinct keys present. The map is not modified.
Failure
Cannot fail. LOG_FATAL via ValidateMap(m) when m is uninitialised or corrupted.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Map.Access.c:39:
result = result && (MapValueCountForKey(&map, 9) == 1);
result = result && (MapValueCountForKey(&map, 8) == 0);
result = result && (MapUniqueKeyCount(&map) == 2);
MapDeinit(&map);- In
Map.Ops.c:132:
result = result && MapContainsPair(&first, 2, 20);
result = result && (MapPairCount(&first) == 2);
result = result && (MapUniqueKeyCount(&first) == 2);
MapSwap(&first, &second);
Last updated on