about summary refs log tree commit diff stats
path: root/011load.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-05-07 15:49:40 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-05-07 15:49:40 -0700
commit05d177737c980aad2fcdb54765433e02021ab1e0 (patch)
tree3b146349a2674db7e585f396bfb5eb0062c4ccd9 /011load.cc
parent0487a30e7078861ed7de42bdb21b5c71fb9b54a1 (diff)
downloadmu-05d177737c980aad2fcdb54765433e02021ab1e0.tar.gz
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 '[^ ]\['
Diffstat (limited to '011load.cc')
-rw-r--r--011load.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/011load.cc b/011load.cc
index ae793b59..e7ff0142 100644
--- a/011load.cc
+++ b/011load.cc
@@ -81,15 +81,15 @@ bool next_instruction(istream& in, instruction* curr) {
   }
   skip_whitespace_and_comments(in);  if (in.eof()) return false;
 
-//?   if (words.size() == 1) cout << words[0] << ' ' << words[0].size() << '\n'; //? 1
-  if (words.size() == 1 && words[0] == "]") {
+//?   if (words.size() == 1) cout << words.at(0) << ' ' << words.at(0).size() << '\n'; //? 1
+  if (words.size() == 1 && words.at(0) == "]") {
 //?     cout << "AAA\n"; //? 1
     return false;  // end of recipe
   }
 
-  if (words.size() == 1 && !isalnum(words[0][0]) && words[0][0] != '$') {
+  if (words.size() == 1 && !isalnum(words.at(0).at(0)) && words.at(0).at(0) != '$') {
     curr->is_label = true;
-    curr->label = words[0];
+    curr->label = words.at(0);
     trace("parse") << "label: " << curr->label;
     return !in.eof();
   }
@@ -203,9 +203,9 @@ void show_rest_of_stream(istream& in) {
 vector<recipe_number> recently_added_recipes;
 :(before "End Setup")
 for (index_t i = 0; i < recently_added_recipes.size(); ++i) {
-//?   cout << "AAA clearing " << Recipe[recently_added_recipes[i]].name << '\n'; //? 2
-  Recipe_number.erase(Recipe[recently_added_recipes[i]].name);
-  Recipe.erase(recently_added_recipes[i]);
+//?   cout << "AAA clearing " << Recipe[recently_added_recipes.at(i)].name << '\n'; //? 2
+  Recipe_number.erase(Recipe[recently_added_recipes.at(i)].name);
+  Recipe.erase(recently_added_recipes.at(i));
 }
 // Clear Other State For recently_added_recipes
 recently_added_recipes.clear();