From f22250a174d5ad5abf8bf99ad140ced52563aee2 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 20 Feb 2016 21:58:48 -0800 Subject: 2680 Delete all the [] that has crept in since 2377 in November. --- 045closure_name.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to '045closure_name.cc') diff --git a/045closure_name.cc b/045closure_name.cc index 52e415fc..cb258583 100644 --- a/045closure_name.cc +++ b/045closure_name.cc @@ -73,8 +73,8 @@ void collect_surrounding_spaces(const recipe_ordinal r) { continue; } if (contains_key(Surrounding_space, r) - && Surrounding_space[r] != get(Recipe_ordinal, surrounding_recipe_name)) { - raise_error << "recipe " << get(Recipe, r).name << " can have only one 'surrounding' recipe but has " << get(Recipe, Surrounding_space[r]).name << " and " << surrounding_recipe_name << '\n' << end(); + && get(Surrounding_space, r) != get(Recipe_ordinal, surrounding_recipe_name)) { + raise_error << "recipe " << get(Recipe, r).name << " can have only one 'surrounding' recipe but has " << get(Recipe, get(Surrounding_space, r)).name << " and " << surrounding_recipe_name << '\n' << end(); continue; } trace(9993, "name") << "lexically surrounding space for recipe " << get(Recipe, r).name << " comes from " << surrounding_recipe_name << end(); @@ -83,7 +83,7 @@ void collect_surrounding_spaces(const recipe_ordinal r) { raise << "can't find recipe providing surrounding space for " << get(Recipe, r).name << ": " << surrounding_recipe_name << '\n' << end(); continue; } - Surrounding_space[r] = get(Recipe_ordinal, surrounding_recipe_name); + put(Surrounding_space, r, get(Recipe_ordinal, surrounding_recipe_name)); } } } @@ -132,8 +132,8 @@ recipe_ordinal lookup_surrounding_recipe(const recipe_ordinal r, long long int n raise_error << "don't know surrounding recipe of " << get(Recipe, r).name << '\n' << end(); return 0; } - assert(Surrounding_space[r]); - return lookup_surrounding_recipe(Surrounding_space[r], n-1); + assert(contains_key(Surrounding_space, r)); + return lookup_surrounding_recipe(get(Surrounding_space, r), n-1); } //: weaken use-before-set detection just a tad -- cgit 1.4.1-2-gfad0