From f3760b0f2828250b4b5fb1a52601fe6b11ff328f Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 6 Nov 2015 13:22:16 -0800 Subject: 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 --- 010vm.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '010vm.cc') 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 << "?"; -- cgit 1.4.1-2-gfad0