diff --git a/src/item.cpp b/src/item.cpp index 0be9fedd96acd..51648801548f6 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -12521,7 +12521,7 @@ bool item::is_soft() const return false; } - const std::map mats = made_of(); + const std::map &mats = made_of(); return std::all_of( mats.begin(), mats.end(), []( const std::pair &mid ) { return mid.first->soft(); } ); diff --git a/src/item_contents.cpp b/src/item_contents.cpp index 28412e4581b93..13a926e800a72 100644 --- a/src/item_contents.cpp +++ b/src/item_contents.cpp @@ -552,9 +552,6 @@ void item_contents::force_insert_item( const item &it, item_pocket::pocket_type std::pair item_contents::best_pocket( const item &it, item_location &parent, const item *avoid, const bool allow_sealed, const bool ignore_settings ) { - if( !can_contain( it ).success() ) { - return { item_location(), nullptr }; - } std::pair ret; ret.second = nullptr; for( item_pocket &pocket : contents ) { @@ -1191,8 +1188,7 @@ std::list item_contents::all_items_top( const std::function contained_items = pocket.all_items_top(); - all_items_internal.insert( all_items_internal.end(), contained_items.begin(), - contained_items.end() ); + all_items_internal.splice( all_items_internal.end(), std::move( contained_items ) ); } } return all_items_internal; @@ -1219,8 +1215,7 @@ std::list item_contents::all_items_top( const for( const item_pocket &pocket : contents ) { if( filter( pocket ) ) { std::list contained_items = pocket.all_items_top(); - all_items_internal.insert( all_items_internal.end(), contained_items.begin(), - contained_items.end() ); + all_items_internal.splice( all_items_internal.end(), std::move( contained_items ) ); } } return all_items_internal;