MapKeyHash
Description
Key-hash callback installed at MapInit. Same shape as the GenericHash callbacks Map / Vec accept elsewhere.
Parameters
| Name | Direction | Description |
|---|---|---|
m |
in | Map. |
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Init.c:210:
MapInsertR(&map, 6, 60);
bool result = (MapKeyHash(&map) == i32_hash) && (MapKeyCompare(&map) == i32_compare) && (MapPairCount(&map) == 2);
result = result && MapGetFirstPtr(&map, 5) && (*MapGetFirstPtr(&map, 5) == 50);
result = result && MapGetFirstPtr(&map, 6) && (*MapGetFirstPtr(&map, 6) == 60);- In
Type.c:63:
bool result = MapPairCount(&map) == 0 && MapCapacity(&map) == 0 && MapTombstones(&map) == 0 &&
MapEntries(&map) == NULL && MapStates(&map) == NULL && MapKeyCompare(&map) == i32_compare &&
MapValueCompare(&map) == NULL && MapKeyHash(&map) == i32_hash &&
MapPolicy(&map).should_rehash == MapPolicyLinear.should_rehash &&
MapPolicy(&map).next_capacity == MapPolicyLinear.next_capacity &&- In
Type.c:81:
bool result =
MapKeyCompare(&map) == i32_compare && MapValueCompare(&map) == i32_compare && MapKeyHash(&map) == i32_hash;
MapDeinit(&map);- In
Type.c:147:
IntIntMap map = MapInitWithValueCompareAndPolicy(i32_hash, i32_compare, i32_compare, custom_policy, &alloc);
bool result = MapKeyHash(&map) == i32_hash && MapKeyCompare(&map) == i32_compare &&
MapValueCompare(&map) == i32_compare && ZstrCompare(MapPolicy(&map).name, "vcmp-policy") == 0 &&
MapPolicy(&map).should_rehash == custom_should_rehash_snapshot &&- In
Type.c:172:
);
bool result = MapKeyHash(&map) == (GenericHash)zstr_hash && MapKeyCompare(&map) == (GenericCompare)zstr_compare &&
MapValueCompare(&map) == NULL && MapKeyCopyInit(&map) == (GenericCopyInit)zstr_init_clone &&
MapKeyCopyDeinit(&map) == (GenericCopyDeinit)zstr_deinit &&
Last updated on