From 05d177737c980aad2fcdb54765433e02021ab1e0 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 7 May 2015 15:49:40 -0700 Subject: 1299 - stop using [] in any vector Useful check: $ grep "[^ '\"]\[[^\"]" *.cc \ |perl -pwe 's/\Wargv\[|\WTests\[|\Wframe\[|\WMemory\[|\WName\[|\WSurrounding_space\[|\WRecipe\[|\WType\[|\WRecipe_number\[|\WType_number\[|\WBefore_fragments\[|\WAfter_fragments\[//g' \ |perl -pwe 's/\Wargv\[|\WTests\[|\Wframe\[|\WMemory\[|\WName\[|\WSurrounding_space\[|\WRecipe\[|\WType\[|\WRecipe_number\[|\WType_number\[|\WBefore_fragments\[|\WAfter_fragments\[//g' \ |grep '[^ ]\[' --- 012transform.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to '012transform.cc') diff --git a/012transform.cc b/012transform.cc index 2c1e4610..209eb5d9 100644 --- a/012transform.cc +++ b/012transform.cc @@ -21,7 +21,7 @@ void transform_all() { recipe& r = p->second; if (r.steps.empty()) continue; if (r.transformed_until != t-1) continue; - (*Transform[t])(/*recipe_number*/p->first); + (*Transform.at(t))(/*recipe_number*/p->first); r.transformed_until = t; } } @@ -34,12 +34,12 @@ void parse_int_reagents() { recipe& r = p->second; if (r.steps.empty()) continue; for (index_t index = 0; index < r.steps.size(); ++index) { - instruction& inst = r.steps[index]; + instruction& inst = r.steps.at(index); for (index_t i = 0; i < inst.ingredients.size(); ++i) { - populate_value(inst.ingredients[i]); + populate_value(inst.ingredients.at(i)); } for (index_t i = 0; i < inst.products.size(); ++i) { - populate_value(inst.products[i]); + populate_value(inst.products.at(i)); } } } -- cgit 1.4.1-2-gfad0