Skip to content

Commit 2ebb9db

Browse files
committed
GUIFontCache: Reduce allocations by reusing map nodes
1 parent fa5c2da commit 2ebb9db

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

xbmc/guilib/GUIFontCache.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,10 @@ class CGUIFontCacheImpl
6565
{
6666
if (ageit->second == it)
6767
{
68-
ageMap.erase(ageit);
69-
ageMap.insert(typename AgeMap::value_type(now, it));
68+
auto node = ageMap.extract(ageit);
69+
node.key() = now;
70+
node.mapped() = it;
71+
ageMap.insert(std::move(node));
7072
it->second->m_lastUsed = now;
7173
return;
7274
}

0 commit comments

Comments
 (0)