Skip to content
Browse files
Use set for getFields
  • Loading branch information
NathanW2 committed Jan 3, 2014
1 parent 8aa6a4d commit 44d9682
Showing 1 changed file with 5 additions and 12 deletions.
@@ -320,18 +320,11 @@ def getFields(self, layer, datatype):
elif datatype == ParameterTableField.DATA_TYPE_NUMBER:
fieldTypes = [QtCore.QVariant.Int, QtCore.QVariant.Double]

fieldNames = []
fields = layer.pendingFields()
if len(fieldTypes) == 0:
for field in fields:
if not in fieldNames:
for field in fields:
if field.type() in fieldTypes and not \
in fieldNames:
return sorted(fieldNames, cmp=locale.strcoll)
fieldNames = set()
for field in layer.pendingFields():
if not fieldTypes or field.type() in fieldTypes:
return sorted(list(fieldNames), cmp=locale.strcoll)

def somethingDependsOnThisParameter(self, parent):
for param in self.alg.parameters:

0 comments on commit 44d9682

Please sign in to comment.