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:
@@ -221,7 +221,7 @@ class UndoHistory(ManagedWindow.ManagedWindow):
|
||||
self.model.append(row=[time_text,mod_text,fg,bg])
|
||||
|
||||
# Get the not-None portion of transaction list
|
||||
translist = [item for item in self.undodb.translist if item]
|
||||
translist = filter(None, self.undodb.translist)
|
||||
for transaction in translist:
|
||||
time_text = time.ctime(transaction.timestamp)
|
||||
mod_text = transaction.get_description()
|
||||
|
Reference in New Issue
Block a user