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;