diff options
Diffstat (limited to 'list.h')
-rw-r--r-- | list.h | 25 |
1 files changed, 4 insertions, 21 deletions
@@ -88,7 +88,7 @@ bool hash_remove_fast (struct hash *hash, const void *key, uint32_t hv); -void hash_remove_by_value (struct hash *hash, void *value, bool autolock); +void hash_remove_by_value (struct hash *hash, void *value); struct hash_iterator { @@ -98,18 +98,16 @@ struct hash_iterator struct hash_element *elem; struct hash_element *last; bool bucket_marked; - bool autolock; int bucket_index_start; int bucket_index_end; }; void hash_iterator_init_range (struct hash *hash, struct hash_iterator *hi, - bool autolock, int start_bucket, int end_bucket); -void hash_iterator_init (struct hash *hash, struct hash_iterator *iter, bool autolock); +void hash_iterator_init (struct hash *hash, struct hash_iterator *iter); struct hash_element *hash_iterator_next (struct hash_iterator *hi); void hash_iterator_delete_element (struct hash_iterator *hi); void hash_iterator_free (struct hash_iterator *hi); @@ -147,21 +145,12 @@ hash_bucket (struct hash *hash, uint32_t hv) return &hash->buckets[hv & hash->mask]; } -static inline void -hash_bucket_lock (struct hash_bucket *bucket) -{ -} - -static inline void -hash_bucket_unlock (struct hash_bucket *bucket) -{ -} - static inline void * -hash_lookup_lock (struct hash *hash, const void *key, uint32_t hv) +hash_lookup (struct hash *hash, const void *key) { void *ret = NULL; struct hash_element *he; + uint32_t hv = hash_value (hash, key); struct hash_bucket *bucket = &hash->buckets[hv & hash->mask]; he = hash_lookup_fast (hash, bucket, key, hv); @@ -171,12 +160,6 @@ hash_lookup_lock (struct hash *hash, const void *key, uint32_t hv) return ret; } -static inline void * -hash_lookup (struct hash *hash, const void *key) -{ - return hash_lookup_lock (hash, key, hash_value (hash, key)); -} - /* NOTE: assumes that key is not a duplicate */ static inline void hash_add_fast (struct hash *hash, |