Merge pull request #23071 from ielatif
* pr/23071: Polish "Replace with 'Integer.compare()'" Replace with 'Integer.compare()' Closes gh-23071
This commit is contained in:
commit
cb97a1b371
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -56,7 +56,7 @@ public class InstanceComparator<T> implements Comparator<T> {
|
|||
public int compare(T o1, T o2) {
|
||||
int i1 = getOrder(o1);
|
||||
int i2 = getOrder(o2);
|
||||
return (i1 < i2 ? -1 : (i1 == i2 ? 0 : 1));
|
||||
return (Integer.compare(i1, i2));
|
||||
}
|
||||
|
||||
private int getOrder(@Nullable T object) {
|
||||
|
|
Loading…
Reference in New Issue