From 0aee45a1174cecca6ed4bd703ef6299185fec6b8 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Sun, 23 Jul 2023 22:44:02 +1000 Subject: Cache certain item generation calls from interfaces Helps a little with the lag from recipes when having crafting interfaces open, but it's still noticeable. Also micro-optimized Root maintenance by unlocking the Root mutexes for their respective shared_ptrs earlier once we have our own shared_ptr. --- source/frontend/StarContainerInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/frontend/StarContainerInterface.cpp') diff --git a/source/frontend/StarContainerInterface.cpp b/source/frontend/StarContainerInterface.cpp index 6540dfb..d69138a 100644 --- a/source/frontend/StarContainerInterface.cpp +++ b/source/frontend/StarContainerInterface.cpp @@ -142,7 +142,7 @@ ContainerPane::ContainerPane(WorldClientPtr worldClient, PlayerPtr player, Conta if (container->iconItem()) { auto itemDatabase = Root::singleton().itemDatabase(); - auto iconItem = itemDatabase->item(container->iconItem()); + auto iconItem = itemDatabase->itemShared(container->iconItem()); auto icon = make_shared(iconItem, "/interface/inventory/portrait.png"); icon->showDurability(false); icon->showRarity(false); -- cgit v1.2.3