Skip to content

Commit

Permalink
Change map() calls to list comprehensions for speed
Browse files Browse the repository at this point in the history
  • Loading branch information
pnorman committed Apr 28, 2012
1 parent 9630378 commit a086c32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ogr2osm.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def __init__(self):
Geometry.__init__(self)
self.points = []
def replacejwithi(self, i, j):
self.points = map(lambda x: i if x == j else x, self.points)
self.points = [i if x == j else x for x in self.points]
j.removeparent(self)
i.addparent(self)

Expand All @@ -241,7 +241,7 @@ def __init__(self):
Geometry.__init__(self)
self.members = []
def replacejwithi(self, i, j):
self.members = map(lambda x: i if x == j else x, self.members)
self.members = [i if x == j else x for x in self.members]
j.removeparent(self)
i.addparent(self)

Expand Down

0 comments on commit a086c32

Please sign in to comment.