MapRemoveFirst
Description
Remove and destroy the first entry matching a key.
Parameters
| Name | Direction | Description |
|---|---|---|
m |
in,out | Map. |
lookup_key |
in | Key to remove. |
Success
Returns true. The first matching entry has been removed; its slot is now a tombstone, and key_copy_deinit / value_copy_deinit (if configured) have been invoked on the removed key and value. Map length shrinks by one.
Failure
Returns false when no entry exists for the key. The map is not modified.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Debug.c:379:
size padded = live_rec->padded_size;
self->bytes_in_use -= (u64)requested;
MapRemoveFirst(&self->live, ptr);
if (self->config.force_page_backing) {- In
Map.Remove.c:30:
MapSetOnlyR(&map, 2, 20);
bool result = MapRemoveFirst(&map, 1);
result = result && MapContainsKey(&map, 1);
result = result && (MapValueCountForKey(&map, 1) == 1);- In
Map.Remove.c:119:
}
MapRemoveFirst(&map, 5);
MapSetOnlyR(&map, 105, 205);- In
Map.Access.c:151:
}
MapRemoveFirst(&map, 5);
bool result = (MapValuePtrFromCursor(&map, cursor) == NULL);- In
Map.Init.c:65:
MapInsertR(&map, 1, 11);
MapInsertR(&map, 2, 20);
MapRemoveFirst(&map, 1);
MapClear(&map);- In
Map.Ops.c:120:
MapInsertR(&first, 1, 11);
MapInsertR(&first, 2, 20);
MapRemoveFirst(&first, 1);
MapInsertR(&second, 9, 90);
Last updated on