TP2: Simplify chained conditions.
[TP_POO.git] / TP2 / Liste.java
index 344a2d3325f134a76399c72892b4dbc996768f18..e042612b15c0f8abdf4bcc32e8bf48ea3829c14b 100644 (file)
@@ -139,9 +139,7 @@ public class Liste extends Structure {
 
     public void compacter(int nElements) {
         // Remove the first nElements
-        if (isEmpty()) {
-            return;
-        } else if (nElements == 0) {
+        if (isEmpty() || nElements == 0) {
             return;
         } else if (headNode != null && headNode.getNext() == null) {
             headNode = null;