From 44b548e3d9eb7d265ecdefe6e3b52180a6eb4521 Mon Sep 17 00:00:00 2001 From: Charles Cooper Date: Thu, 31 Mar 2022 22:05:38 +0000 Subject: [PATCH] only loop if left and right are not literals --- vyper/codegen/core.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/vyper/codegen/core.py b/vyper/codegen/core.py index 7b76b5e9b7..d1c0b0b39c 100644 --- a/vyper/codegen/core.py +++ b/vyper/codegen/core.py @@ -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")