about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-02-06 16:15:05 -0800
committerKartik K. Agaram <vc@akkartik.com>2016-02-06 16:15:05 -0800
commit8b3b97e848a3db3c8542c86c7c03fd65f38865a3 (patch)
tree6a51e1e8a5a067e7eb41dae039012072389c52d1
parent7153f7eafbfb80c22ebeb3c1967ebc3960daaa20 (diff)
downloadmu-8b3b97e848a3db3c8542c86c7c03fd65f38865a3.tar.gz
2636
-rw-r--r--057static_dispatch.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/057static_dispatch.cc b/057static_dispatch.cc
index fc860a99..d97dbf0f 100644
--- a/057static_dispatch.cc
+++ b/057static_dispatch.cc
@@ -67,14 +67,12 @@ bool all_reagents_match(const recipe& r1, const recipe& r2) {
   if (SIZE(r1.ingredients) != SIZE(r2.ingredients)) return false;
   if (SIZE(r1.products) != SIZE(r2.products)) return false;
   for (long long int i = 0; i < SIZE(r1.ingredients); ++i) {
-    if (!deeply_equal_types(r1.ingredients.at(i).properties.at(0).second,
-                            r2.ingredients.at(i).properties.at(0).second)) {
+    if (!deeply_equal_types(r1.ingredients.at(i), r2.ingredients.at(i))) {
       return false;
     }
   }
   for (long long int i = 0; i < SIZE(r1.products); ++i) {
-    if (!deeply_equal_types(r1.products.at(i).properties.at(0).second,
-                            r2.products.at(i).properties.at(0).second)) {
+    if (!deeply_equal_types(r1.products.at(i), r2.products.at(i))) {
       return false;
     }
   }
@@ -87,6 +85,9 @@ set<string> Literal_type_names;
 Literal_type_names.insert("number");
 Literal_type_names.insert("character");
 :(code)
+bool deeply_equal_types(const reagent& a, const reagent& b) {
+  return deeply_equal_types(a.properties.at(0).second, b.properties.at(0).second);
+}
 bool deeply_equal_types(const string_tree* a, const string_tree* b) {
   if (!a) return !b;
   if (!b) return !a;