repositories
/
TP_POO.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0f1b201
)
TP2: Simplify chained conditions.
author
Jérôme Benoit
<jerome.benoit@piment-noir.org>
Sun, 4 Mar 2018 19:50:38 +0000
(20:50 +0100)
committer
Jérôme Benoit
<jerome.benoit@piment-noir.org>
Sun, 4 Mar 2018 19:50:38 +0000
(20:50 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
TP2/Liste.java
patch
|
blob
|
blame
|
history
diff --git
a/TP2/Liste.java
b/TP2/Liste.java
index 344a2d3325f134a76399c72892b4dbc996768f18..e042612b15c0f8abdf4bcc32e8bf48ea3829c14b 100644
(file)
--- 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;