MapForeachValue
Description
Iterate over all stored values by value.
Parameters
| Name | Direction | Description |
|---|---|---|
m |
in,out | Map to iterate over. |
value_var |
in | Name of variable bound to a copy of each stored value. |
Success
The loop body runs once per occupied slot with value_var bound to a copy of the stored value. The body is skipped when m is empty. Mutating the local does not write back into the map.
Failure
The macro itself does not fail. LOG_FATAL via ValidateMap(m) when m is uninitialised or corrupted.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Foreach.c:71:
}
MapForeachValue(&map, value) {
all_value_sum += value;
}- In
Foreach.c:141:
int after_sum = 0;
MapForeachValue(&map, value) {
after_sum += value;
}- In
Foreach.c:177:
n += 1;
}
MapForeachValue(&map, v) {
(void)v;
n += 1;
Last updated on