Fix NextPosizioneLibera e main

This commit is contained in:
La Programmatrice Verde
2025-09-25 16:53:48 +02:00
parent 745acce18e
commit 284de5110f
2 changed files with 6 additions and 8 deletions

View File

@@ -21,11 +21,9 @@ public class Garage {
private int NextPosizioneLibera() {
boolean exit = true;
int i = 0;
for (; i < this.veicoli.length && exit; i++) {
if (this.veicoli[i] == null) {
exit = false;
}
int i = -1;
for (; i < this.veicoli.length && this.veicoli[i] != null; ++i) {
;
}
return i;
}