|
@@ -3,7 +3,6 @@ package com.tzld.piaoquan.ad.engine.commons.util;
|
|
import com.tzld.piaoquan.recommend.feature.domain.ad.base.AdRankItem;
|
|
import com.tzld.piaoquan.recommend.feature.domain.ad.base.AdRankItem;
|
|
|
|
|
|
import java.util.Comparator;
|
|
import java.util.Comparator;
|
|
-import java.util.Random;
|
|
|
|
|
|
|
|
public class ComparatorUtil {
|
|
public class ComparatorUtil {
|
|
|
|
|
|
@@ -15,8 +14,11 @@ public class ComparatorUtil {
|
|
if (comparison != 0) {
|
|
if (comparison != 0) {
|
|
return comparison;
|
|
return comparison;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ return Long.compare(o1.hashCode(), o2.hashCode());
|
|
|
|
+
|
|
// 数字相等时随机排列
|
|
// 数字相等时随机排列
|
|
- return new Random().nextInt(3) - 1; // 产生-1、0或1的随机值
|
|
|
|
|
|
+ // return new Random().nextInt(3) - 1; // 产生-1、0或1的随机值
|
|
}
|
|
}
|
|
};
|
|
};
|
|
}
|
|
}
|