Skip to content

Commit

Permalink
Don't unnecessarily copy items in a tight loop in get_uncraft_components
Browse files Browse the repository at this point in the history
  • Loading branch information
akrieger committed Sep 20, 2024
1 parent 7b773c1 commit 7c286c7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14908,8 +14908,7 @@ std::vector<item_comp> item::get_uncraft_components() const
if( component.has_flag( flag_UNRECOVERABLE ) ) {
continue;
}
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks)
auto iter = std::find_if( ret.begin(), ret.end(), [component]( item_comp & obj ) {
auto iter = std::find_if( ret.begin(), ret.end(), [&component]( item_comp & obj ) {
return obj.type == component.typeId();
} );

Expand Down

0 comments on commit 7c286c7

Please sign in to comment.