Fix Path.size() and add test for Path.size().

This commit is contained in:
2018-03-21 11:13:01 +01:00
parent 46436f81f3
commit e2d1d47beb
2 changed files with 11 additions and 1 deletions

View File

@@ -176,7 +176,7 @@ public class Path {
* @return Number of nodes in this path.
*/
public int size() {
return 1 + this.arcs.size();
return isEmpty() ? 0 : 1 + this.arcs.size();
}
/**