diff options
-rw-r--r-- | 053recipe_header.cc | 9 | ||||
-rw-r--r-- | 057immutable.cc | 8 |
2 files changed, 9 insertions, 8 deletions
diff --git a/053recipe_header.cc b/053recipe_header.cc index e6cc51d9..87b018c8 100644 --- a/053recipe_header.cc +++ b/053recipe_header.cc @@ -248,6 +248,15 @@ def foo a:num [ if (is_present_in_ingredients(get(Recipe, get(Recipe_ordinal, recipe_name)), x.name)) raise << " did you forget 'load-ingredients'?\n" << end(); +:(code) +bool is_present_in_ingredients(const recipe& callee, const string& ingredient_name) { + for (int i = 0; i < SIZE(callee.ingredients); ++i) { + if (callee.ingredients.at(i).name == ingredient_name) + return true; + } + return false; +} + //:: Check all calls against headers. :(scenario show_clear_error_on_bad_call) diff --git a/057immutable.cc b/057immutable.cc index 4b7e4a68..53c7c171 100644 --- a/057immutable.cc +++ b/057immutable.cc @@ -501,14 +501,6 @@ bool is_present_in_products(const recipe& callee, const string& ingredient_name) return false; } -bool is_present_in_ingredients(const recipe& callee, const string& ingredient_name) { - for (int i = 0; i < SIZE(callee.ingredients); ++i) { - if (callee.ingredients.at(i).name == ingredient_name) - return true; - } - return false; -} - set<int> ingredient_indices(const instruction& inst, const set<reagent>& ingredient_names) { set<int> result; for (int i = 0; i < SIZE(inst.ingredients); ++i) { |