Simplify with built-in functions where possible. e.g.
change [x for x in y if x] to filter(None, y) change [f(x) for x in y] to map(f, x) change [x for x in y] to list(y) These changes reduce source code size and complexity and produce some minor performance gains svn: r14104
This commit is contained in:
@@ -1601,7 +1601,7 @@ class DbWriteBase(object):
|
||||
self.set_default_person_handle(None)
|
||||
|
||||
# loop through the family list
|
||||
for family_handle in [ f for f in person.get_family_handle_list() if f ]:
|
||||
for family_handle in filter(None, person.get_family_handle_list()):
|
||||
|
||||
family = self.get_family_from_handle(family_handle)
|
||||
|
||||
|
Reference in New Issue
Block a user