1
0
Fork 0

update isValid()

This commit is contained in:
Sebastien Moll 2026-04-15 17:03:43 +02:00
parent b65f6c27ca
commit 6613be4663

View file

@ -189,11 +189,11 @@ public class Path {
if (this.isEmpty()) { return true; }
if (this.size() == 1 && this.arcs.isEmpty()) { return true; }
if (this.arcs.get(0).getOrigin() != this.origin) { return false; }
if (!this.arcs.get(0).getOrigin().equals(this.origin)) { return false; }
Boolean good = true;
for (int i = 0; i < this.arcs.size() - 1; i++) {
if (this.arcs.get(i).getDestination() != this.arcs.get(i+1).getOrigin()) {
if (!this.arcs.get(i).getDestination().equals(this.arcs.get(i+1).getOrigin())) {
good = false;
}
}