This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [gold patch obvious] Remove unnecessary code in Sort_commons::operator()
- From: =?big5?b?RG91ZyBLd2FuICjD9q62vHcp?= <dougkwan at google dot com>
- To: Cary Coutant <ccoutant at google dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Wed, 18 Aug 2010 13:29:36 -0700
- Subject: Re: [gold patch obvious] Remove unnecessary code in Sort_commons::operator()
- References: <AANLkTik7Xcvcb_bmCDwU5uCLhZJP4Ze73o1GMG5=1u=D@mail.gmail.com>
Are you absolutely sure that this will produce the same sorting result
on both OSX and Linux, which have different implementation of qsort?
在 2010年8月18日上午11:38,Cary Coutant <ccoutant@google.com> 寫道:
> This patch just removes some unnecessary code that was equivalent to a
> NOP. Committed as obvious (after verifying with Ian that the original
> code wasn't trying to do something more subtle).
>
> -cary
>
>
> * common.cc (Sort_commons::operator()): Remove unnecessary code.
>
>
> Index: common.cc
> ===================================================================
> RCS file: /cvs/src/src/gold/common.cc,v
> retrieving revision 1.24
> diff -u -p -r1.24 common.cc
> --- common.cc 3 Aug 2010 14:07:13 -0000 1.24
> +++ common.cc 18 Aug 2010 18:30:13 -0000
> @@ -88,16 +88,7 @@ bool
> Sort_commons<size>::operator()(const Symbol* pa, const Symbol* pb) const
> {
> if (pa == NULL)
> - {
> - if (pb == NULL)
> - {
> - // Stabilize sort. The order really doesn't matter, because
> - // these entries will be discarded, but we want to return
> - // the same result every time we compare pa and pb.
> - return pa < pb;
> - }
> - return false;
> - }
> + return false;
> if (pb == NULL)
> return true;
>