From 3ffc4f0ec4dc7a485dc322e6d2f16333a82b7fa0 Mon Sep 17 00:00:00 2001 From: Eric Pierce Date: Sat, 8 Feb 2020 14:27:06 -0700 Subject: [PATCH] Use ternary expression instead of 6-liner --- src/item.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/item.cpp b/src/item.cpp index 50af046e87ad1..3db57d5ffc59c 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -3296,13 +3296,7 @@ void item::final_info( std::vector &info, const iteminfo_query *parts, // list recipes you could use it in if( parts->test( iteminfo_parts::DESCRIPTION_APPLICABLE_RECIPES ) ) { - itype_id tid; - if( contents.empty() ) { // use this item - tid = typeId(); - } else { // use the contained item - tid = contents.front().typeId(); - } - + itype_id tid = contents.empty() ? typeId() : contents.front().typeId(); const inventory &crafting_inv = g->u.crafting_inventory(); const recipe_subset available_recipe_subset = g->u.get_available_recipes( crafting_inv ); const std::set &item_recipes = available_recipe_subset.of_component( tid );