about summary refs log tree commit diff stats
path: root/041jump_target.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-11-06 13:22:16 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-11-06 13:22:30 -0800
commitf3760b0f2828250b4b5fb1a52601fe6b11ff328f (patch)
tree69ec57c652ff823e92146281ba656e3eaba57eb7 /041jump_target.cc
parent12f304a333ecee6326a8111e0d8e1c494ee92087 (diff)
downloadmu-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 '041jump_target.cc')
-rw-r--r--041jump_target.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/041jump_target.cc b/041jump_target.cc
index d7ff717a..3bd8cedb 100644
--- a/041jump_target.cc
+++ b/041jump_target.cc
@@ -27,7 +27,7 @@ void transform_labels(const recipe_ordinal r) {
   for (long long int i = 0; i < SIZE(get(Recipe, r).steps); ++i) {
     const instruction& inst = get(Recipe, r).steps.at(i);
     if (!inst.label.empty() && inst.label.at(0) == '+') {
-      if (offset.find(inst.label) == offset.end()) {
+      if (!contains_key(offset, inst.label)) {
         offset[inst.label] = i;
       }
       else {
@@ -71,7 +71,7 @@ void replace_offset(reagent& x, /*const*/ map<string, long long int>& offset, co
     x.set_value(0);  // no jump by default
     return;
   }
-  if (offset.find(x.name) == offset.end()) {
+  if (!contains_key(offset, x.name)) {
     raise_error << maybe(get(Recipe, r).name) << "can't find label " << x.name << '\n' << end();
     x.set_value(0);  // no jump by default
     return;