Avoid creating an unnecessary list (use an iterator instead)
This commit is contained in:
parent
36d79b4bb2
commit
19bfc010c8
@ -125,7 +125,7 @@ init python early:
|
|||||||
if isinstance(obj, _list):
|
if isinstance(obj, _list):
|
||||||
return [make_revertable(x) for x in obj]
|
return [make_revertable(x) for x in obj]
|
||||||
elif isinstance(obj, _dict):
|
elif isinstance(obj, _dict):
|
||||||
return dict([(make_revertable(k), make_revertable(v)) for (k,v) in obj.items()])
|
return dict((make_revertable(k), make_revertable(v)) for (k,v) in obj.items())
|
||||||
else:
|
else:
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user