boostorg / compute

A C++ GPU Computing Library for OpenCL

Home Page:http://boostorg.github.io/compute/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

ankurhero opened this issue · comments

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.

I don't think this will work as iterator is not passing to the location corresponding to key but to a random position ( map.end() ).