PeerMonitor: simplify getAddressForPeer() with trinary operator

This commit is contained in:
Sean Gilligan 2022-08-23 01:01:29 +02:00 committed by Andreas Schildbach
parent b21b10774a
commit 39d799e58f

View File

@ -252,13 +252,11 @@ public class PeerMonitor {
}
}
private Object getAddressForPeer(Peer peer) {
String s;
s = reverseDnsLookups.get(peer);
if (s != null)
return s;
else
return peer.getAddress().getAddr().getHostAddress();
private String getAddressForPeer(Peer peer) {
String s = reverseDnsLookups.get(peer);
return (s != null)
? s
: peer.getAddress().getAddr().getHostAddress();
}
private String getAddressesForPeer(Peer peer) {