Skip to content

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

Open
cheerconi wants to merge 2 commits intoboostorg:masterfrom
cheerconi:master
Open

Avoid unnecessary copy value and map.find in lru_cache#859
cheerconi wants to merge 2 commits intoboostorg:masterfrom
cheerconi:master

Conversation

@cheerconi
Copy link

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
Copy link

Coverage Status

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants