From 016599f1d2f861a5c36e6f88c05c98ef88e0ee85 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 27 Nov 2015 22:01:23 -0800 Subject: 2484 Eliminate one of several hacky type-check helpers; they've been proliferating lately. --- 035call_ingredient.cc | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to '035call_ingredient.cc') diff --git a/035call_ingredient.cc b/035call_ingredient.cc index 919320ea..2f28c8f7 100644 --- a/035call_ingredient.cc +++ b/035call_ingredient.cc @@ -22,7 +22,7 @@ recipe f [ :(before "End call Fields") vector > ingredient_atoms; -vector ingredient_types; +vector ingredients; long long int next_ingredient_to_process; :(before "End call Constructor") next_ingredient_to_process = 0; @@ -32,13 +32,9 @@ for (long long int i = 0; i < SIZE(ingredients); ++i) { current_call().ingredient_atoms.push_back(ingredients.at(i)); reagent ingredient = call_instruction.ingredients.at(i); canonize_type(ingredient); - current_call().ingredient_types.push_back(ingredient.type); + current_call().ingredients.push_back(ingredient); ingredient.type = NULL; // release long-lived pointer } -:(before "End call Destructor") -for (long long int i = 0; i < SIZE(ingredient_types); ++i) { - delete ingredient_types.at(i); -} :(before "End Primitive Recipe Declarations") NEXT_INGREDIENT, @@ -65,8 +61,7 @@ case NEXT_INGREDIENT: { raise_error << "main: wrong type for ingredient " << product.original_string << '\n' << end(); } else if (!types_match(product, - current_call().ingredient_types.at(current_call().next_ingredient_to_process), - current_call().ingredient_atoms.at(current_call().next_ingredient_to_process))) { + current_call().ingredients.at(current_call().next_ingredient_to_process))) { raise_error << maybe(current_recipe_name()) << "wrong type for ingredient " << product.original_string << '\n' << end(); } products.push_back( -- cgit 1.4.1-2-gfad0