diff --git a/modules/core/src/main/java/org/locationtech/jts/noding/MCIndexNoder.java b/modules/core/src/main/java/org/locationtech/jts/noding/MCIndexNoder.java index 185672310d..e21feecc84 100644 --- a/modules/core/src/main/java/org/locationtech/jts/noding/MCIndexNoder.java +++ b/modules/core/src/main/java/org/locationtech/jts/noding/MCIndexNoder.java @@ -91,27 +91,21 @@ public void computeNodes(Collection inputSegStrings) private void intersectChains() { MonotoneChainOverlapAction overlapAction = new SegmentOverlapAction(segInt); - - /** - * following test makes sure we only compare each pair of chains once - * and that we don't compare a chain to itself - */ - for (MonotoneChain queryChain : monoChains) { - Envelope queryEnv = queryChain.getEnvelope(overlapTolerance); - for (MonotoneChain testChain : index.query(queryEnv)) { - /** - * following test makes sure we only compare each pair of chains once - * and that we don't compare a chain to itself - */ - if (testChain.getId() > queryChain.getId()) { - queryChain.computeOverlaps(testChain, overlapTolerance, overlapAction); - nOverlaps++; - } - // short-circuit if possible - if (segInt.isDone()) - return; - } + for (MonotoneChain queryChain : monoChains) { + Envelope queryEnv = queryChain.getEnvelope(overlapTolerance); + for (MonotoneChain testChain : index.query(queryEnv)) { + /** + * following test makes sure we only compare each pair of chains once + * and that we don't compare a chain to itself + */ + if (testChain.getId() > queryChain.getId()) { + queryChain.computeOverlaps(testChain, overlapTolerance, overlapAction); + nOverlaps++; + } + // short-circuit if possible + if (segInt.isDone()) return; } + } } private void add(SegmentString segStr)