Skip to content

Commit aca5c60

Browse files
alexmalyshevmeta-codesync[bot]
authored andcommitted
refactor: simplify identity list comprehension in swaptimize
Summary: Replace `[i for i in range(depth)]` with `list(range(depth))`. The identity list comprehension is unnecessary since `list(range(depth))` produces the same result more concisely. Reviewed By: yoney Differential Revision: D99701348 fbshipit-source-id: a6979ee4a0a35f4b95f2c4b3a5fb61c1e3a06be9
1 parent a001e45 commit aca5c60

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cinderx/PythonLib/cinderx/compiler/flow_graph_optimizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ def swaptimize(self, instr_index: int, block: Block) -> int | None:
698698
return None
699699

700700
# Create an array with elements {0, 1, 2, ..., depth - 1}:
701-
stack = [i for i in range(depth)]
701+
stack = list(range(depth))
702702
# Simulate the combined effect of these instructions by "running" them on
703703
# our "stack":
704704
for i in range(instr_index, cnt):

0 commit comments

Comments
 (0)