Skip to content

Commit a10936f

Browse files
committed
Use a set for classes in PointsInPolygonUnique (faster)
1 parent 596b56c commit a10936f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/plugins/processing/algs/qgis/PointsInPolygonUnique.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def processAlgorithm(self, progress):
9090

9191
attrs = ftPoly.attributes()
9292

93-
classes = []
93+
classes = set()
9494
points = spatialIndex.intersects(geom.boundingBox())
9595
if len(points) > 0:
9696
request = QgsFeatureRequest().setFilterFids(points)
@@ -101,7 +101,7 @@ def processAlgorithm(self, progress):
101101
if engine.contains(tmpGeom.geometry()):
102102
clazz = ftPoint.attributes()[classFieldIndex]
103103
if clazz not in classes:
104-
classes.append(clazz)
104+
classes.add(clazz)
105105

106106
outFeat.setGeometry(geom)
107107
if idxCount == len(attrs):

0 commit comments

Comments
 (0)