X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fhash.c;h=91fc3d6754341c0d738b802ce925cb7522268991;hb=1140ca6d3004b228947bad8736f0b49d6b169267;hp=8fb9ca69fd7f5e20b403a74052f733681b605c05;hpb=5e00a24e1f13fa70a6945831c409d873b7809d11;p=tinc diff --git a/src/hash.c b/src/hash.c index 8fb9ca69..91fc3d67 100644 --- a/src/hash.c +++ b/src/hash.c @@ -91,6 +91,13 @@ void *hash_search_or_insert(hash_t *hash, const void *key, const void *value) { return NULL; } +/* Deleting */ + +void hash_delete(hash_t *hash, const void *key) { + uint32_t i = modulo(hash_function(key, hash->size), hash->n); + hash->values[i] = NULL; +} + /* Utility functions */ void hash_clear(hash_t *hash) {