mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-01-18 13:22:42 +01:00
PeerMonitor: simplify getAddressForPeer() with trinary operator
This commit is contained in:
parent
b21b10774a
commit
39d799e58f
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user