Use built-in functions to replace for loops:
Old code: for x in y: f(x) New Code: map(f, y) Also use defaultdict instead of simple dict when advantageous and use list comprehensions instead of for loops where map() could be used but requires lambdas. svn: r14135
This commit is contained in:
@@ -525,9 +525,7 @@ class WebCalReport(Report):
|
||||
|
||||
# An optional link to a home page
|
||||
navs.append((self.home_link, _('html|Home'), add_home))
|
||||
|
||||
for month in range(1, 13):
|
||||
navs.append((month, month, True))
|
||||
navs.extend((month, month, True) for month in range(1,13))
|
||||
|
||||
# Add a link for year_glance() if requested
|
||||
navs.append(('fullyearlinked', _('Year Glance'), self.fullyear))
|
||||
|
Reference in New Issue
Block a user