replaced verbose loop with comprehension

master
Salvo 'LtWorf' Tomaselli 2017-04-24 00:41:52 +07:00
parent 6014618f2d
commit 6caf8bc741
No known key found for this signature in database
GPG Key ID: B3A7CF0C801886CF
1 changed files with 1 additions and 4 deletions

@ -237,10 +237,7 @@ class Node (object):
elif self.kind == BINARY and self.name == DIVISION: elif self.kind == BINARY and self.name == DIVISION:
return list(set(self.left.result_format(rels)) - set(self.right.result_format(rels))) return list(set(self.left.result_format(rels)) - set(self.right.result_format(rels)))
elif self.name == PROJECTION: elif self.name == PROJECTION:
l = [] return [i.strip() for i in self.prop.split(',')]
for i in self.prop.split(','):
l.append(i.strip())
return l
elif self.name == PRODUCT: elif self.name == PRODUCT:
return self.left.result_format(rels) + self.right.result_format(rels) return self.left.result_format(rels) + self.right.result_format(rels)
elif self.name == SELECTION: elif self.name == SELECTION: