Skip to content

Conversation

@mmalferov
Copy link
Member

Let's tell the reader the truth :)

 * Adds a new element, or updates the value if the key already is part of the hash
 *
 * Parameters:
 * - hash: A valid quickhash
 * - key: The key
 * - value: The value
 *
 * Returns:
 * - 1 if the element is part of the hash and was updated, 2 if the element was
 *   added or 0 if an error occurred.
 */
int qhi_hash_set(qhi *hash, qhv key, qhv value)
{...

    if (find_bucket_from_list(...)) {
        return qhi_update_value_in_bucket(...); // returns 1
    } else {
        return qhi_add_entry_to_list(...) ? 2 : 0; // returns 2 or 0
    }...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant