avoid creating thousands of unmodifiable lists just to get their size
This commit is contained in:
parent
cf2765e017
commit
d9effc4a29
@ -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();
|
||||||
|
Loading…
Reference in New Issue
Block a user