boostorg / compute

A C++ GPU Computing Library for OpenCL
http://boostorg.github.io/compute/
Boost Software License 1.0
1.52k stars 333 forks source link

Avoid unnecessary copy value and map.find in lru_cache #859

Open cheerconi opened 3 years ago

cheerconi commented 3 years ago

The operator[] is a find-or-add operator. Use m_map.emplace to avoid add operation. And use i->second.second to avoid find operation.

coveralls commented 3 years ago

Coverage Status

Coverage decreased (-0.006%) to 84.013% when pulling d0e7f5aaf7dbbe34f8a51360ec3bb52fbf789b42 on cheerconi:master into 36c89134d4013b2e5e45bc55656a18bd6141995a on boostorg:master.