1998-05-25 Mark Mitchell <mark@markmitchell.com>
+ * call.c (tourney): Don't do any extra comparisons.
+
* decl2.c (build_anon_union_vars): Don't crash on empty sub-unions.
* cp-tree.h (processing_template_parmlist): Declare.
{
struct z_candidate *champ = candidates, *challenger;
int fate;
+ int champ_compared_to_predecessor = 0;
/* Walk through the list once, comparing each current champ to the next
candidate, knocking out a candidate or two with each comparison. */
champ = challenger->next;
if (champ == 0)
return 0;
+ champ_compared_to_predecessor = 0;
}
else
- champ = challenger;
+ {
+ champ = challenger;
+ champ_compared_to_predecessor = 1;
+ }
challenger = champ->next;
}
}
/* Make sure the champ is better than all the candidates it hasn't yet
- been compared to. This may do one more comparison than necessary. Oh
- well. */
+ been compared to. */
- for (challenger = candidates; challenger != champ;
+ for (challenger = candidates;
+ challenger != champ
+ && !(champ_compared_to_predecessor && challenger->next == champ);
challenger = challenger->next)
{
fate = joust (champ, challenger, 0);