From cbb803fa94ca0b3168abea40455e096a054568b6 Mon Sep 17 00:00:00 2001 From: anothersimulacrum Date: Mon, 20 Apr 2020 12:41:01 -0700 Subject: [PATCH] Use reference in loop, not copy --- src/advanced_inv.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/advanced_inv.cpp b/src/advanced_inv.cpp index fd7016c3e0719..ad92a4cfbd93c 100644 --- a/src/advanced_inv.cpp +++ b/src/advanced_inv.cpp @@ -820,7 +820,7 @@ bool advanced_inventory::move_all_items( bool nested_call ) // Check some preconditions to quickly leave the function. size_t liquid_items = 0; - for( const advanced_inv_listitem elem : spane.items ) { + for( const advanced_inv_listitem &elem : spane.items ) { for( const item *elemit : elem.items ) { if( elemit->made_of_from_type( LIQUID ) && !elemit->is_frozen_liquid() ) { liquid_items++;