Comment 21 for bug 1246802

Revision history for this message
In , Christopher Jefferson (azumanga) wrote :

(In reply to Paolo Carlini from comment #13)
> Ok, note that I was reviewing the description you originally sent to the
> mailing list and it never talked about the - 2...
>
> Let's figure out something safe, please.

I miswrote in my final paragraph:

...first+1, mid, last-1 (there is no reason in this bug to consider
last-1 instead of last, but I thought it wouldn't do any harm, and
might avoid other issues of accidentally choosing a bad pivot.

Should have said:

...first+1, mid, last-2 (there is no reason in this bug to consider *last-2* instead of *last-1*, but I thought it wouldn't do any harm, and might avoid other issues of accidentally choosing a bad pivot.

So, the original code chose last-1, I moved that to last-2, not checking all the places that called the code enough (although, I could also have broken it with the first+1 if the ranges had been small enough).

Changing 'last-2' to 'last-1' might well be the easiest, smallest fix, if it does not effect the performance testsuite. We can then, once we have a much more comphrehensive testsuite, make another pass at performance improvements and tweaks.