From b50531895c1f6bfd2c8752cf8d9bd1eb323f75c7 Mon Sep 17 00:00:00 2001 From: neveix Date: Fri, 14 Aug 2026 20:12:33 +0500 Subject: [PATCH] remove redundant allocations --- src/graphics/ui/elements/InventoryView.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/graphics/ui/elements/InventoryView.cpp b/src/graphics/ui/elements/InventoryView.cpp index 45edf8ee2..9449ce3b0 100644 --- a/src/graphics/ui/elements/InventoryView.cpp +++ b/src/graphics/ui/elements/InventoryView.cpp @@ -367,7 +367,7 @@ void SlotView::performLeftClick(ItemStack& stack, ItemStack& grabbed) { ); return; } - auto indices = *content->getIndices(); + auto& indices = *content->getIndices(); if (!layout.itemSource && stack.accepts(grabbed) && layout.placing) { action = InteractionAction::PUT; stack.move(grabbed, indices); @@ -387,13 +387,13 @@ void SlotView::performLeftClick(ItemStack& stack, ItemStack& grabbed) { void SlotView::actIfCannotPut(ItemStack& stack, ItemStack& grabbed, InteractionAction& action) { const auto& input = gui.getInput(); - auto indices = *content->getIndices(); + auto& indices = *content->getIndices(); if (layout.itemSource) { if (grabbed.isEmpty()) { action = InteractionAction::TAKE; grabbed.set(stack); if (input.pressed(Keycode::LEFT_CONTROL)) { - grabbed.maximizeCount(*content->getIndices()); + grabbed.maximizeCount(indices); } } else { if (grabbed.accepts(stack)) {