about summary refs log tree commit diff stats
path: root/033exclusive_container.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-03-28 10:11:23 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-03-28 10:11:23 -0700
commita5401241a1976e6a3b102f1b70e5af66c7f205fb (patch)
treebe0137c76677b76d856356c6e0c3cc35a8a3b19e /033exclusive_container.cc
parent9f73b16511406dd8281b615b138d8648e854ca52 (diff)
downloadmu-a5401241a1976e6a3b102f1b70e5af66c7f205fb.tar.gz
2818
Diffstat (limited to '033exclusive_container.cc')
-rw-r--r--033exclusive_container.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/033exclusive_container.cc b/033exclusive_container.cc
index 5c1fe6ad..2a006a99 100644
--- a/033exclusive_container.cc
+++ b/033exclusive_container.cc
@@ -8,7 +8,7 @@
 //: We'll use this container as a running example, with two number elements.
 {
 type_ordinal tmp = put(Type_ordinal, "number-or-point", Next_type_ordinal++);
-get_or_insert(Type, tmp).size = 2;
+get_or_insert(Type, tmp);  // initialize
 get(Type, tmp).kind = EXCLUSIVE_CONTAINER;
 get(Type, tmp).name = "number-or-point";
 get(Type, tmp).elements.push_back(reagent("i:number"));
@@ -35,7 +35,7 @@ if (t.kind == EXCLUSIVE_CONTAINER) {
   // size of an exclusive container is the size of its largest variant
   // (So like containers, it can't contain arrays.)
   int result = 0;
-  for (int i = 0; i < t.size; ++i) {
+  for (int i = 0; i < SIZE(t.elements); ++i) {
     reagent tmp;
     tmp.type = new type_tree(*type);
     int size = size_of(variant_type(tmp, i));