about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-11-07 12:41:08 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-11-07 12:41:08 -0800
commit273f8be9c048d19273f87afc62b34727811b7871 (patch)
tree97bd8399c6d62dab77634cd3cdbdbcf9a0b25909
parent15f79a66ee32a8cce7667a9c9ec718517a48f2bf (diff)
downloadmu-273f8be9c048d19273f87afc62b34727811b7871.tar.gz
2386 - core tests passing again
Layer 1 of edit/ is introducing spurious types, though.
-rw-r--r--057static_dispatch.cc4
-rw-r--r--059generic_recipe.cc1
2 files changed, 3 insertions, 2 deletions
diff --git a/057static_dispatch.cc b/057static_dispatch.cc
index 8a35f086..0d687385 100644
--- a/057static_dispatch.cc
+++ b/057static_dispatch.cc
@@ -23,7 +23,7 @@ map<string, vector<recipe_ordinal> > Recipe_variants;
 for (map<string, vector<recipe_ordinal> >::iterator p = Recipe_variants.begin(); p != Recipe_variants.end(); ++p) {
   for (long long int i = 0; i < SIZE(p->second); ++i) {
     if (p->second.at(i) >= Reserved_for_tests)
-      p->second.at(i) = -1;
+      p->second.at(i) = -1;  // just leave a ghost
   }
 }
 
@@ -136,7 +136,7 @@ void replace_best_variant(instruction& inst) {
 }
 
 long long int variant_score(const instruction& inst, recipe_ordinal variant) {
-  if (variant == -1) return -1;
+  if (variant == -1) return -1;  // ghost from a previous test
   const vector<reagent>& header_ingredients = get(Recipe, variant).ingredients;
   if (SIZE(inst.ingredients) < SIZE(header_ingredients)) {
     trace(9993, "transform") << "too few ingredients" << end();
diff --git a/059generic_recipe.cc b/059generic_recipe.cc
index e435f3f3..7b0ef162 100644
--- a/059generic_recipe.cc
+++ b/059generic_recipe.cc
@@ -57,6 +57,7 @@ if (any_type_ingredient_in_header(r)) return;
 recipe_ordinal pick_matching_generic_variant(vector<recipe_ordinal>& variants, const instruction& inst, long long int& best_score) {
   recipe_ordinal result = 0;
   for (long long int i = 0; i < SIZE(variants); ++i) {
+    if (variants.at(i) == -1) continue;  // ghost from a previous test
     trace(9992, "transform") << "checking generic variant " << i << end();
     long long int current_score = generic_variant_score(inst, variants.at(i));
     trace(9992, "transform") << "final score: " << current_score << end();