MapRemovePair
MapRemovePair
Description
Remove and destroy the first matching key/value pair.
Parameters
| Name | Direction | Description |
|---|---|---|
m |
in,out | Map. |
key |
in | Key to remove. |
value |
in | Value to remove. |
Success
true if the pair existed and was removed.
Failure
false
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Map.c:1012:
if (!map->value_compare) {
LOG_FATAL("MapRemovePair requires a value comparator");
}- In
Map.Remove.c:46:
MapInsertR(&map, 5, 52);
bool result = MapRemovePair(&map, 5, 51);
result = result && MapContainsPair(&map, 5, 50);
result = result && !MapContainsPair(&map, 5, 51);
Last updated on