Avoid creating an unnecessary list (use an iterator instead)

This commit is contained in:
Gouvernathor 2023-11-11 20:54:41 +01:00 committed by LoafyLemon
parent 36d79b4bb2
commit 19bfc010c8

View File

@ -125,7 +125,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