Skip to content

Commit 44407a5

Browse files
Update literals.py
1 parent e67f467 commit 44407a5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

mypyc/codegen/literals.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,8 @@ def _encode_collection_values(
169169
# even though frozensets are not sorted in python, we need to sort the items here
170170
# to improve the determinism of the generated C file, making it easier to compare
171171
# differences in the C files generated by different versions of your code.
172-
sort_keys_to_values = {str(v) + type(v).__name__: v for v in value}
173-
items = tuple(
174-
sort_keys_to_values[sort_key] for sort_key in sorted(sort_keys_to_values)
175-
)
172+
sort_helper = {str(v) + type(v).__name__: v for v in value}
173+
items = tuple(sort_helper[key] for key in sorted(sort_helper))
176174
else:
177175
items = value
178176
for item in items:

0 commit comments

Comments
 (0)