about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-04-29 09:23:16 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-04-29 09:23:16 -0700
commit80ca5945f89d5a8f1932a006b2565d11adad4446 (patch)
treeced6c24f79f5680c4938b7780c66b72509b72dd1
parent7f902016015e4a7a82d1650e52e7d6f227fcf0ee (diff)
downloadmu-80ca5945f89d5a8f1932a006b2565d11adad4446.tar.gz
2886
-rw-r--r--057shape_shifting_container.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/057shape_shifting_container.cc b/057shape_shifting_container.cc
index 8014b86a..1b9d51b7 100644
--- a/057shape_shifting_container.cc
+++ b/057shape_shifting_container.cc
@@ -283,7 +283,6 @@ void replace_type_ingredients(type_tree* element_type, const type_tree* callsite
 
   // B. replace the current location
   const type_tree* replacement = NULL;
-  bool splice_right = true ;
   bool zig_left = false;
   {
     const type_tree* curr = callsite_type;
@@ -298,7 +297,6 @@ void replace_type_ingredients(type_tree* element_type, const type_tree* callsite
       // rather than {foo: (number)}
       // We'd also like to use it with multiple types: foo:address:number.
       replacement = curr;
-      splice_right = final_type_ingredient(type_ingredient_index, container_info);
     }
   }
   if (element_type->right && replacement->right && zig_left) {  // ZERO confidence that this condition is accurate
@@ -312,7 +310,7 @@ void replace_type_ingredients(type_tree* element_type, const type_tree* callsite
     element_type->value = replacement->value;
     assert(!element_type->left);  // since value is set
     element_type->left = replacement->left ? new type_tree(*replacement->left) : NULL;
-    if (splice_right) {
+    if (zig_left || final_type_ingredient(type_ingredient_index, container_info)) {
       type_tree* old_right = element_type->right;
       element_type->right = replacement->right ? new type_tree(*replacement->right) : NULL;
       append(element_type->right, old_right);