Avoid creating an unnecessary list (use an iterator instead)

This commit is contained in:
Gouvernathor 2023-11-11 20:54:41 +01:00
parent 20fcacf97b
commit 18f3ae4219

View File

@ -122,7 +122,7 @@ init python early:
if isinstance(obj, _list):
return [make_revertable(x) for x in obj]
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:
return obj