avoid creating thousands of unmodifiable lists just to get their size

This commit is contained in:
Leijurv 2018-11-25 22:59:47 -08:00
parent cf2765e017
commit d9effc4a29
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -62,6 +62,11 @@ public class SplicedPath extends PathBase {
return numNodes; return numNodes;
} }
@Override
public int length() {
return path.size();
}
public static Optional<SplicedPath> trySplice(IPath first, IPath second, boolean allowOverlapCutoff) { public static Optional<SplicedPath> trySplice(IPath first, IPath second, boolean allowOverlapCutoff) {
if (second == null || first == null) { if (second == null || first == null) {
return Optional.empty(); return Optional.empty();