Skip to content

zhashx_dup() should use previous hashes comparator and key functions? #2144

@chu11

Description

@chu11

Recently used zhashx_dup() to copy a hash, leading to an assert in zhashx_insert() while in the middle of the copy iteration in zhashx_dup().

Eventually, I determined the issue was that we use an alternate setting of the key hasher, comparator, duplicator, and destructor. However in zhashx_dup() it does not appear to copy those over. It only copies over the item duplicator/destructor.

    zhashx_t *copy = zhashx_new ();
    if (copy) {
        copy->destructor = self->destructor;
        copy->duplicator = self->duplicator;

I think it should be using the same hasher/key functions across the board?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions