RFR: jsr166 integration 2018-06

Doug Lea dl at cs.oswego.edu
Sun Jun 24 20:29:03 UTC 2018


On 06/22/2018 01:28 PM, Paul Sandoz wrote:

>> 8203864: Execution error in Java's Timsort
>> http://cr.openjdk.java.net/~martin/webrevs/jdk/jsr166-integration/TimSort/index.html
>> https://bugs.openjdk.java.net/browse/JDK-8203864
>>
> 
>  406             if (n > 0 && runLen[n-1] <= runLen[n] + runLen[n+1] ||
>  407                 n > 1 && runLen[n-2] <= runLen[n] + runLen[n-1]) {
>  408                 if (runLen[n - 1] < runLen[n + 1])
>  409                     n--;
> 
> Minor comment, would be good if consistent style is used for the index expressions. I have a marginal preference to retaining ordering from a “picture this in my head" kind of thing, specifically:
> 
>   runLen[n - 2] <= runLen[n - 1] + runLen[n]

I marginally agree, but I'm keeping it this way just for boring
consistency with published versions.

-Doug





More information about the core-libs-dev mailing list