diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-11-06 13:22:16 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-11-06 13:22:30 -0800 |
commit | f3760b0f2828250b4b5fb1a52601fe6b11ff328f (patch) | |
tree | 69ec57c652ff823e92146281ba656e3eaba57eb7 /057static_dispatch.cc | |
parent | 12f304a333ecee6326a8111e0d8e1c494ee92087 (diff) | |
download | mu-f3760b0f2828250b4b5fb1a52601fe6b11ff328f.tar.gz |
2379 - further improvements to map operations
Commands run: $ sed -i 's/\([^. (]*\)\.find(\([^)]*\)) != [^.]*\.end()/contains_key(\1, \2)/g' 0[^0]*cc $ sed -i 's/\([^. (]*\)\.find(\([^)]*\)) == [^.]*\.end()/!contains_key(\1, \2)/g' 0[^0]*cc
Diffstat (limited to '057static_dispatch.cc')
-rw-r--r-- | 057static_dispatch.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/057static_dispatch.cc b/057static_dispatch.cc index 905cbaf2..597ef4d0 100644 --- a/057static_dispatch.cc +++ b/057static_dispatch.cc @@ -28,7 +28,7 @@ for (map<string, vector<recipe_ordinal> >::iterator p = Recipe_variants.begin(); } :(before "End Load Recipe Header(result)") -if (Recipe_ordinal.find(result.name) != Recipe_ordinal.end()) { +if (contains_key(Recipe_ordinal, result.name)) { if ((Recipe.find(get(Recipe_ordinal, result.name)) == Recipe.end() || get(Recipe, get(Recipe_ordinal, result.name)).has_header) && !header_already_exists(result)) { @@ -113,7 +113,7 @@ void resolve_ambiguous_calls(recipe_ordinal r) { for (long long int index = 0; index < SIZE(get(Recipe, r).steps); ++index) { instruction& inst = get(Recipe, r).steps.at(index); if (inst.is_label) continue; - if (Recipe_variants.find(inst.name) == Recipe_variants.end()) continue; + if (!contains_key(Recipe_variants, inst.name)) continue; assert(!Recipe_variants[inst.name].empty()); replace_best_variant(inst); } |