mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8277868: Use Comparable.compare() instead of surrogate code
Reviewed-by: rriggs, aivanov
This commit is contained in:
parent
937126b140
commit
20db7800a6
12 changed files with 23 additions and 75 deletions
|
@ -3416,8 +3416,7 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
|
|||
}
|
||||
|
||||
private int compareTo(long t) {
|
||||
long thisTime = getMillisOf(this);
|
||||
return (thisTime > t) ? 1 : (thisTime == t) ? 0 : -1;
|
||||
return Long.compare(getMillisOf(this), t);
|
||||
}
|
||||
|
||||
private static long getMillisOf(Calendar calendar) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue