X-Git-Url: https://git.piment-noir.org/?p=TP_POO.git;a=blobdiff_plain;f=TP2%2FListe.java;h=6928b00737e0656548f61f6b49cc791812f80b77;hp=344a2d3325f134a76399c72892b4dbc996768f18;hb=78c725c5e287068ee24d4abb950de2ab9520d76a;hpb=39d7332090951dc583cd3039fd6b18b809a88693 diff --git a/TP2/Liste.java b/TP2/Liste.java index 344a2d3..6928b00 100644 --- a/TP2/Liste.java +++ b/TP2/Liste.java @@ -1,5 +1,8 @@ - +@ClassPreamble ( + author = "Jérôme Benoit", + date = "05/12/2011" +) public class Liste extends Structure { private class IntNode { @@ -139,9 +142,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;