<i18n dev> RFR: 8277868: Use Comparable.compare() instead of surrogate code [v3]

Сергей Цыпанов duke at openjdk.java.net
Tue Dec 7 14:39:51 UTC 2021


On Tue, 7 Dec 2021 12:01:27 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> Сергей Цыпанов has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8277868: Inline local var
>
> src/java.base/share/classes/java/util/Calendar.java line 3420:
> 
>> 3418:     private int compareTo(long t) {
>> 3419:         long thisTime = getMillisOf(this);
>> 3420:         return Long.compare(thisTime, t);
> 
> Probably, in this case `thisTime` variable can also be dropped.

Inlined

> src/java.base/share/classes/java/util/Date.java line 977:
> 
>> 975:         long thisTime = getMillisOf(this);
>> 976:         long anotherTime = getMillisOf(anotherDate);
>> 977:         return Long.compare(thisTime, anotherTime);
> 
> Looks like local variables can also be dropped here as each value is used once.

Inlined

-------------

PR: https://git.openjdk.java.net/jdk/pull/6575


More information about the i18n-dev mailing list