X-Git-Url: https://git.piment-noir.org/?p=TP_POO.git;a=blobdiff_plain;f=TP2%2FListe.java;h=e042612b15c0f8abdf4bcc32e8bf48ea3829c14b;hp=344a2d3325f134a76399c72892b4dbc996768f18;hb=dbd5b97740865a496231e49a086ca3dd325aecdf;hpb=0f1b20188428cc8f90cb68ec4775f0b67be0c077 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;