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:
@@ -83,9 +83,9 @@ class AgeStatsGramplet(Gramplet):
|
||||
age_dict = {}
|
||||
mother_dict = {}
|
||||
father_dict = {}
|
||||
age_handles = [[] for age in range(self.max_age)]
|
||||
mother_handles = [[] for age in range(self.max_mother_diff)]
|
||||
father_handles = [[] for age in range(self.max_father_diff)]
|
||||
age_handles = [[]] * self.max_age
|
||||
mother_handles = [[]] * self.max_mother_diff
|
||||
father_handles = [[]] * self.max_father_diff
|
||||
text = ""
|
||||
count = 0
|
||||
for p in self.dbstate.db.iter_people():
|
||||
|
Reference in New Issue
Block a user