about summary refs log tree commit diff stats
path: root/cpp/018record
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-03-26 20:24:38 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-03-26 20:24:38 -0700
commit3076bab4b62ce2b56c53db6d0b1715429c5bda27 (patch)
tree08c0da74ffee65301953c1186bb7aef1970db16d /cpp/018record
parent62ed0e4728ab0238c47f03dea38782a599bff3fb (diff)
downloadmu-3076bab4b62ce2b56c53db6d0b1715429c5bda27.tar.gz
979
Diffstat (limited to 'cpp/018record')
-rw-r--r--cpp/018record12
1 files changed, 3 insertions, 9 deletions
diff --git a/cpp/018record b/cpp/018record
index 5c1715a4..55c4df0d 100644
--- a/cpp/018record
+++ b/cpp/018record
@@ -43,9 +43,7 @@ case GET: {
   size_t offset = instructions[pc].ingredients[1].value;
   int src = base_address;
   for (size_t i = 0; i < offset; ++i) {
-    reagent tmp;
-    tmp.types.push_back(Type[base_type].elements[i][0]);
-    src += size_of(tmp);
+    src += size_of(Type[base_type].elements[i]);
   }
   trace("run") << "address to copy is " << src;
   assert(Type[base_type].elements.size() > offset);
@@ -121,9 +119,7 @@ case GET_ADDRESS: {
   size_t offset = instructions[pc].ingredients[1].value;
   int src = base_address;
   for (size_t i = 0; i < offset; ++i) {
-    reagent tmp;
-    tmp.types.push_back(Type[base_type].elements[i][0]);
-    src += size_of(tmp);
+    src += size_of(Type[base_type].elements[i]);
   }
   trace("run") << "address to copy is " << src;
   vector<int> result;
@@ -158,9 +154,7 @@ recipe main [
 if (t.is_record) {
   size_t result = 0;
   for (size_t i = 0; i < t.elements.size(); ++i) {
-    reagent x;
-    x.types.push_back(t.elements[i][0]);
-    result += size_of(x);
+    result += size_of(t.elements[i]);
   }
   return result;
 }