mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix bug
This commit is contained in:
@@ -46,6 +46,14 @@ public class IndexedComparator<T> implements Comparator<T> {
|
||||
final int index1 = getOrder(o1);
|
||||
final int index2 = getOrder(o2);
|
||||
|
||||
// 任意一个元素不在列表中
|
||||
if(index1 == index2){
|
||||
if(index1 < 0 || index1 == this.array.length){
|
||||
// 任意一个元素不在列表中, 返回原顺序
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return Integer.compare(index1, index2);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user