Merge pull request #19 from scossu/const_set

Make item in hashmap_set constant.
pull/25/head
Josh Baker 3 years ago committed by GitHub
commit c5fec45f78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -248,7 +248,7 @@ static bool resize(struct hashmap *map, size_t new_cap) {
// replaced then it is returned otherwise NULL is returned. This operation
// may allocate memory. If the system is unable to allocate additional
// memory then NULL is returned and hashmap_oom() returns true.
void *hashmap_set(struct hashmap *map, void *item) {
void *hashmap_set(struct hashmap *map, const void *item) {
if (!item) {
panic("item is null");
}

@ -36,7 +36,7 @@ void hashmap_clear(struct hashmap *map, bool update_cap);
size_t hashmap_count(struct hashmap *map);
bool hashmap_oom(struct hashmap *map);
void *hashmap_get(struct hashmap *map, const void *item);
void *hashmap_set(struct hashmap *map, void *item);
void *hashmap_set(struct hashmap *map, const void *item);
void *hashmap_delete(struct hashmap *map, void *item);
void *hashmap_probe(struct hashmap *map, uint64_t position);
bool hashmap_scan(struct hashmap *map,

Loading…
Cancel
Save