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:
@@ -1715,8 +1715,7 @@ class DbGrdb(Callback):
|
||||
self.emit(objtype + '-delete', (del_list, ))
|
||||
|
||||
def __do_del(self, del_list, func):
|
||||
for handle in del_list:
|
||||
func(handle)
|
||||
map(func, del_list)
|
||||
return del_list
|
||||
|
||||
def do_commit(self, add_list, db_map):
|
||||
|
Reference in New Issue
Block a user