+ for (entryp = &list->table[bucket]; *entryp != NULL; entryp = &(*entryp)->hash_next)
+ {
+ gl_hash_entry_t entry = *entryp;
+
+ if (entry->hashcode == hashcode)
+ {
+ if (((struct gl_multiple_nodes *) entry)->magic == MULTIPLE_NODES_MAGIC)
+ {
+ /* An entry representing multiple nodes. */
+ gl_oset_t nodes = ((struct gl_multiple_nodes *) entry)->nodes;
+ /* Only the first node is interesting. */
+ gl_list_node_t node = gl_oset_first (nodes);
+ if (equals != NULL ? equals (value, node->value) : value == node->value)
+ {
+ /* Found already multiple nodes with the same value.
+ Add the new_node to it. */
+ return gl_oset_nx_add (nodes, new_node);
+ }
+ }
+ else
+ {
+ /* An entry representing a single node. */
+ gl_list_node_t node = (struct gl_list_node_impl *) entry;
+ if (equals != NULL ? equals (value, node->value) : value == node->value)
+ {
+ /* Found already a node with the same value. Turn it
+ into an ordered set, and add new_node to it. */
+ gl_oset_t nodes;
+ struct gl_multiple_nodes *multi_entry;