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 /010vm.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 '010vm.cc')
-rw-r--r-- | 010vm.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/010vm.cc b/010vm.cc index 5f583a73..31749999 100644 --- a/010vm.cc +++ b/010vm.cc @@ -273,7 +273,7 @@ type_tree* new_type_tree(const string_tree* properties) { type_tree* result = new type_tree(0); if (!properties->value.empty()) { const string& type_name = properties->value; - if (Type_ordinal.find(type_name) == Type_ordinal.end() + if (!contains_key(Type_ordinal, type_name) // types can contain integers, like for array sizes && !is_integer(type_name)) { put(Type_ordinal, type_name, Next_type_ordinal++); @@ -413,7 +413,7 @@ void dump_types_tree(const type_tree* type, ostream& out) { } void dump_type_name(recipe_ordinal type, ostream& out) { - if (Type.find(type) != Type.end()) + if (contains_key(Type, type)) out << get(Type, type).name; else out << "?"; |