[tor-commits] [onionoo/master] Simplify if statement.

karsten at torproject.org karsten at torproject.org
Mon Dec 8 12:22:56 UTC 2014


commit 4016623189b2c8dac023461b1b58e91b549643e7
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date:   Mon Dec 8 09:44:36 2014 +0100

    Simplify if statement.
    
    Suggested by iwakeh on #12651.
---
 src/main/java/org/torproject/onionoo/docs/NodeStatus.java |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/main/java/org/torproject/onionoo/docs/NodeStatus.java b/src/main/java/org/torproject/onionoo/docs/NodeStatus.java
index e3dcdaf..99436bf 100644
--- a/src/main/java/org/torproject/onionoo/docs/NodeStatus.java
+++ b/src/main/java/org/torproject/onionoo/docs/NodeStatus.java
@@ -121,8 +121,7 @@ public class NodeStatus extends Document {
     }
     if (this.orAddressesAndPorts != null) {
       for (String orAddressAndPort : this.orAddressesAndPorts) {
-        if (orAddressAndPort.contains(":") &&
-            orAddressAndPort.length() > 0) {
+        if (orAddressAndPort.contains(":")) {
           String orAddress = orAddressAndPort.substring(0,
               orAddressAndPort.lastIndexOf(':'));
           orAddresses.add(orAddress);





More information about the tor-commits mailing list