diff --git a/src/item.cpp b/src/item.cpp index 2643dd5b3ee12..6d1e7729a7af2 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -14908,8 +14908,7 @@ std::vector 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(); } );