Skip to content

Unwanted function call for std::map::operator[] #866

Open
@ankurhero

Description

@ankurhero

m_map[key] = std::make_pair(value, j);

Since i is a valid iterator, we can replace this call with.
m_map[key] = std::make_pair(value, j);

with

i->second = std::make_pair(value, j);

avoiding the second map search.

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