+static inline struct cso_node **
+cso_hash_find_node(struct cso_hash *hash, unsigned akey)
+{
+ struct cso_node **node;
+
+ if (hash->numBuckets) {
+ node = &hash->buckets[akey % hash->numBuckets];
+ assert(*node == hash->end || (*node)->next);
+ while (*node != hash->end && (*node)->key != akey)
+ node = &(*node)->next;
+ } else {
+ node = &hash->end;
+ }
+ return node;
+}
+
+/**
+ * Return an iterator pointing to the first entry in the collision list.
+ */
+static inline struct cso_hash_iter
+cso_hash_find(struct cso_hash *hash, unsigned key)
+{
+ struct cso_node **nextNode = cso_hash_find_node(hash, key);
+ struct cso_hash_iter iter = {hash, *nextNode};
+ return iter;
+}
+
+static inline struct cso_hash_iter
+cso_hash_iter_next(struct cso_hash_iter iter)
+{
+ struct cso_hash_iter next = {iter.hash, cso_hash_data_next(iter.node)};
+ return next;
+}