X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fhash.c;h=91fc3d6754341c0d738b802ce925cb7522268991;hb=9d48d5b7d48ad23e23eae02feae69bdc5ae80c8e;hp=8fb9ca69fd7f5e20b403a74052f733681b605c05;hpb=6062df4a0fa6214d21ac83d885087e9dbdac3f39;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) {