mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +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
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -79,7 +79,7 @@ public final class GraphicsPrimitiveMgr {
|
|||
int id1 = o1.getUniqueID();
|
||||
int id2 = o2.getUniqueID();
|
||||
|
||||
return (id1 == id2 ? 0 : (id1 < id2 ? -1 : 1));
|
||||
return Integer.compare(id1, id2);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -88,7 +88,7 @@ public final class GraphicsPrimitiveMgr {
|
|||
int id1 = ((GraphicsPrimitive) o1).getUniqueID();
|
||||
int id2 = ((PrimitiveSpec) o2).uniqueID;
|
||||
|
||||
return (id1 == id2 ? 0 : (id1 < id2 ? -1 : 1));
|
||||
return Integer.compare(id1, id2);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue