Skip to content

Adding and checking key exintence at the same time with the .add method #31

@Konstantinusz

Description

@Konstantinusz

#add method would be better, and faster in some scenarios, if it also could return a logical value (true/false) which signs if the key already was there, or it was added "cleanly" as a new, yet non-existent key. In my application I should check if a key already exists, and I also should add the (hopefully) new key everytime. In fact I use the trie structure as a "hash" or "set" replacement, because my key strings share a lot of long common prefixes. So checking key existence char-by-char could return earlier with a false value, compared to when using a "hash" or a "set".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions