repositories
/
TP_POO.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
TP2: Implement the Image class as a Comparator<Image> interface.
[TP_POO.git]
/
TP2
/
Entiers.java
diff --git
a/TP2/Entiers.java
b/TP2/Entiers.java
index 7d55c4264a81aead1a278a11ed0549e90dbd0b7c..b690d10426728590f0efa8365a448f1cd531baa6 100644
(file)
--- a/
TP2/Entiers.java
+++ b/
TP2/Entiers.java
@@
-105,8
+105,12
@@
class Entiers extends Structure {
}
public void compacter(int nElements) {
- // Remove the last nElements
- current_size -= nElements;
+ if (current_size - nElements > 0) {
+ // Remove the last nElements
+ current_size -= nElements;
+ } else {
+ current_size = 0;
+ }
}
}