Optimization suggested by Ray.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2267 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -56,7 +56,7 @@ public class ObjectUtil
|
|||||||
*/
|
*/
|
||||||
public static <T extends Comparable<? super T>> int compareTo (T left, T right)
|
public static <T extends Comparable<? super T>> int compareTo (T left, T right)
|
||||||
{
|
{
|
||||||
if (left == null && right == null) {
|
if (left == right) { // instances are both null or both the same instance
|
||||||
return 0;
|
return 0;
|
||||||
} else if (left == null) {
|
} else if (left == null) {
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user