Skip to content

Commit f9e595a

Browse files
committed
feat(net): use comparingLong method for sortPeers
1 parent e8e61fe commit f9e595a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

framework/src/main/java/org/tron/core/net/peer/PeerManager.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ private static void remove(PeerConnection peerConnection) {
9595

9696
public static synchronized void sortPeers() {
9797
try {
98-
peers.sort(Comparator.comparingDouble(c -> c.getChannel().getAvgLatency()));
98+
peers.sort(Comparator.comparingLong(c -> c.getChannel().getAvgLatency()));
9999
} catch (Exception e) {
100100
logger.warn("Sort peers failed. {}", e.getMessage());
101101
}

0 commit comments

Comments
 (0)