diff options
-rw-r--r-- | 054static_dispatch.cc | 8 | ||||
-rw-r--r-- | html/054static_dispatch.cc.html | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/054static_dispatch.cc b/054static_dispatch.cc index 7fdfa391..6e2638ef 100644 --- a/054static_dispatch.cc +++ b/054static_dispatch.cc @@ -325,12 +325,12 @@ const recipe& best_variant(const instruction& inst, vector<recipe_ordinal>& cand int score = abs(SIZE(candidate.products)-SIZE(inst.products)) + abs(SIZE(candidate.ingredients)-SIZE(inst.ingredients)); // prefer functions with non-address ingredients or products - for (int i = 0; i < SIZE(candidate.ingredients); ++i) { - if (is_mu_address(candidate.ingredients.at(i))) + for (int j = 0; j < SIZE(candidate.ingredients); ++j) { + if (is_mu_address(candidate.ingredients.at(j))) ++score; } - for (int i = 0; i < SIZE(candidate.products); ++i) { - if (is_mu_address(candidate.products.at(i))) + for (int j = 0; j < SIZE(candidate.products); ++j) { + if (is_mu_address(candidate.products.at(j))) ++score; } assert(score < 999); diff --git a/html/054static_dispatch.cc.html b/html/054static_dispatch.cc.html index f3723be9..c3f2c8cc 100644 --- a/html/054static_dispatch.cc.html +++ b/html/054static_dispatch.cc.html @@ -390,12 +390,12 @@ if ('onhashchange' in window) { <span id="L325" class="LineNr">325 </span> <span class="Conceal">¦</span> <span class="Normal">int</span> score = abs<span class="Delimiter">(</span><a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>candidate<span class="Delimiter">.</span>products<span class="Delimiter">)</span>-SIZE<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>products<span class="Delimiter">))</span> <span id="L326" class="LineNr">326 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> + abs<span class="Delimiter">(</span><a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>candidate<span class="Delimiter">.</span>ingredients<span class="Delimiter">)</span>-SIZE<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">));</span> <span id="L327" class="LineNr">327 </span> <span class="Conceal">¦</span> <span class="Comment">// prefer functions with non-address ingredients or products</span> -<span id="L328" class="LineNr">328 </span> <span class="Conceal">¦</span> <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = <span class="Constant">0</span><span class="Delimiter">;</span> i < <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>candidate<span class="Delimiter">.</span>ingredients<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L329" class="LineNr">329 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>is_mu_address<span class="Delimiter">(</span>candidate<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">)))</span> +<span id="L328" class="LineNr">328 </span> <span class="Conceal">¦</span> <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> j = <span class="Constant">0</span><span class="Delimiter">;</span> j < <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>candidate<span class="Delimiter">.</span>ingredients<span class="Delimiter">);</span> ++j<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L329" class="LineNr">329 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>is_mu_address<span class="Delimiter">(</span>candidate<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>j<span class="Delimiter">)))</span> <span id="L330" class="LineNr">330 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> ++score<span class="Delimiter">;</span> <span id="L331" class="LineNr">331 </span> <span class="Conceal">¦</span> <span class="Delimiter">}</span> -<span id="L332" class="LineNr">332 </span> <span class="Conceal">¦</span> <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = <span class="Constant">0</span><span class="Delimiter">;</span> i < <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>candidate<span class="Delimiter">.</span>products<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L333" class="LineNr">333 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>is_mu_address<span class="Delimiter">(</span>candidate<span class="Delimiter">.</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">)))</span> +<span id="L332" class="LineNr">332 </span> <span class="Conceal">¦</span> <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> j = <span class="Constant">0</span><span class="Delimiter">;</span> j < <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>candidate<span class="Delimiter">.</span>products<span class="Delimiter">);</span> ++j<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L333" class="LineNr">333 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>is_mu_address<span class="Delimiter">(</span>candidate<span class="Delimiter">.</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span>j<span class="Delimiter">)))</span> <span id="L334" class="LineNr">334 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> ++score<span class="Delimiter">;</span> <span id="L335" class="LineNr">335 </span> <span class="Conceal">¦</span> <span class="Delimiter">}</span> <span id="L336" class="LineNr">336 </span> <span class="Conceal">¦</span> assert<span class="Delimiter">(</span>score < <span class="Constant">999</span><span class="Delimiter">);</span> |