From: Mark Mitchell Date: Mon, 25 May 1998 18:20:09 +0000 (+0000) Subject: * call.c (tourney): Don't do any extra comparisons. X-Git-Tag: prereleases/egcs-1.1-prerelease~1087 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b265c11aae43a501e7cea84865fbc9f3120ad388;p=thirdparty%2Fgcc.git * call.c (tourney): Don't do any extra comparisons. From-SVN: r20051 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 23b61d0e491d..02dbdcda1d2d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,7 @@ 1998-05-25 Mark Mitchell + * 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. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 01bb53fe089e..fb280ebf2bf7 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -4389,6 +4389,7 @@ tourney (candidates) { 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. */ @@ -4405,19 +4406,24 @@ tourney (candidates) 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);