From dbd5b97740865a496231e49a086ca3dd325aecdf Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 4 Mar 2018 20:50:38 +0100 Subject: [PATCH] TP2: Simplify chained conditions. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- TP2/Liste.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/TP2/Liste.java b/TP2/Liste.java index 344a2d3..e042612 100644 --- a/TP2/Liste.java +++ b/TP2/Liste.java @@ -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; -- 2.34.1