Changeset 17037 in josm


Ignore:
Timestamp:
2020-09-18T10:25:02+02:00 (4 years ago)
Author:
GerdP
Message:

fix #19597: validator is very slow when validating a complete complex multipolygon

  • CrossingFinder: don't check if a closed way is crossing a multipolygon relation when the way is a member of that relation (we already ignored this combination when the multipolygon is checked)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java

    r16438 r17037  
    1515import java.util.Map;
    1616import java.util.Objects;
     17import java.util.Set;
    1718import java.util.function.IntFunction;
    1819import java.util.function.IntSupplier;
     
    362363            @Override
    363364            public void visit(Collection<? extends IPrimitive> primitives) {
    364                 List<? extends IPrimitive> toIgnore;
     365                Set<? extends IPrimitive> toIgnore;
    365366                if (e.osm instanceof Relation) {
    366                     toIgnore = ((IRelation<?>) e.osm).getMemberPrimitivesList();
     367                    toIgnore = ((Relation) e.osm).getMemberPrimitives();
    367368                } else {
    368369                    toIgnore = null;
     
    373374                            && left.matches(new Environment(p).withParent(e.osm)) && isArea(p)
    374375                            && (toIgnore == null || !toIgnore.contains(p))) {
     376                        if (e.osm instanceof Way && ((Way)e.osm).referrers(Relation.class).anyMatch(ref -> ref == p))
     377                            continue;
    375378                        visitArea(p);
    376379                    }
Note: See TracChangeset for help on using the changeset viewer.