Skip to content

Commit

Permalink
only loop if left and right are not literals
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Mar 31, 2022
1 parent 5732a3b commit 44b548e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion vyper/codegen/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,13 @@ def _complex_make_setter(left, right):
assert _len == left.typ.storage_size_in_words * 32 # only the paranoid survive
return copy_bytes(left, right, _len, _len)

if isinstance(left.typ, SArrayType) and left.typ.count > ROLL_ARRAY_TUNING:
should_loop = (
isinstance(left.typ, SArrayType)
and left.typ.count > ROLL_ARRAY_TUNING
and not left.is_literal
and not right.is_literal
)
if should_loop:
n = left.typ.count

i = IRnode.from_list(_freshname("copy_sarray_ix"), typ="uint256")
Expand Down

0 comments on commit 44b548e

Please sign in to comment.