Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Simplify expression.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 27 Jun 2018 12:33:38 +0000 (14:33 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 27 Jun 2018 12:40:43 +0000 (14:40 +0200)
examples/java/dht/kademlia/Contact.java

index 7d46bc0..d71d906 100644 (file)
@@ -25,7 +25,7 @@ public class Contact implements Comparable<Object> {
 
   @Override
   public boolean equals(Object x) {
-    return (x == null) ? false : x.equals(id) ;
+    return x != null && x.equals(id);
   }
 
   @Override
@@ -55,4 +55,4 @@ public class Contact implements Comparable<Object> {
     return "Contact [id=" + id + ", distance=" + distance + "]";
   }
 
-}
\ No newline at end of file
+}