Skip to content

Weird side effect of map.lookup_or_init() #2518

Closed
@pjsg

Description

I discovered today that map.lookup_or_init() has bizarre behavior if the insert into the map fails (e.g. the map is full). It is either a documentation error, or an implementation error.

The actual behavior is that lookup_or_init() actually returns (with a return value of 0) from the function in which it is executed!! I would think that the more reasonable approach would be to make the lookup_or_init method itself return 0 if the insert fails....

Thoughts?

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