diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-05-17 12:13:52 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-05-17 12:13:52 -0700 |
commit | caa4275c9a56f4e64ea3bcaf572f76445d305d93 (patch) | |
tree | 8f95c4687e6b6b639f5d57b865eb68b207edb733 | |
parent | d8603e814cc993233a694ead4787a51ae32467c2 (diff) | |
download | mu-caa4275c9a56f4e64ea3bcaf572f76445d305d93.tar.gz |
2967
-rw-r--r-- | 010vm.cc | 34 | ||||
-rw-r--r-- | 030container.cc | 4 |
2 files changed, 19 insertions, 19 deletions
diff --git a/010vm.cc b/010vm.cc index 8565c09d..7c2ccba1 100644 --- a/010vm.cc +++ b/010vm.cc @@ -310,16 +310,16 @@ type_tree* new_type_tree(const string_tree* properties) { //: avoid memory leaks for the type tree -reagent::reagent(const reagent& old) { - original_string = old.original_string; - name = old.name; - value = old.value; - initialized = old.initialized; - for (int i = 0; i < SIZE(old.properties); ++i) { - properties.push_back(pair<string, string_tree*>(old.properties.at(i).first, - old.properties.at(i).second ? new string_tree(*old.properties.at(i).second) : NULL)); +reagent::reagent(const reagent& other) { + original_string = other.original_string; + name = other.name; + value = other.value; + initialized = other.initialized; + for (int i = 0; i < SIZE(other.properties); ++i) { + properties.push_back(pair<string, string_tree*>(other.properties.at(i).first, + other.properties.at(i).second ? new string_tree(*other.properties.at(i).second) : NULL)); } - type = old.type ? new type_tree(*old.type) : NULL; + type = other.type ? new type_tree(*other.type) : NULL; // End reagent Copy Constructor } @@ -336,18 +336,18 @@ string_tree::string_tree(const string_tree& old) { // :value(old.value) { right = old.right ? new string_tree(*old.right) : NULL; } -reagent& reagent::operator=(const reagent& old) { - original_string = old.original_string; +reagent& reagent::operator=(const reagent& other) { + original_string = other.original_string; for (int i = 0; i < SIZE(properties); ++i) if (properties.at(i).second) delete properties.at(i).second; properties.clear(); - for (int i = 0; i < SIZE(old.properties); ++i) - properties.push_back(pair<string, string_tree*>(old.properties.at(i).first, old.properties.at(i).second ? new string_tree(*old.properties.at(i).second) : NULL)); - name = old.name; - value = old.value; - initialized = old.initialized; + for (int i = 0; i < SIZE(other.properties); ++i) + properties.push_back(pair<string, string_tree*>(other.properties.at(i).first, other.properties.at(i).second ? new string_tree(*other.properties.at(i).second) : NULL)); + name = other.name; + value = other.value; + initialized = other.initialized; if (type) delete type; - type = old.type ? new type_tree(*old.type) : NULL; + type = other.type ? new type_tree(*other.type) : NULL; // End reagent Copy Operator return *this; } diff --git a/030container.cc b/030container.cc index 3135d5f2..902afb21 100644 --- a/030container.cc +++ b/030container.cc @@ -108,9 +108,9 @@ struct container_metadata { :(before "End reagent Fields") container_metadata metadata; // can't be a pointer into Container_metadata because we keep changing the base storage when we save/restore snapshots :(before "End reagent Copy Operator") -metadata = old.metadata; +metadata = other.metadata; :(before "End reagent Copy Constructor") -metadata = old.metadata; +metadata = other.metadata; :(before "End Globals") // todo: switch to map after figuring out how to consistently compare type trees |