From ec9502fa159f95f6931c195935ccf09324e7d0d1 Mon Sep 17 00:00:00 2001 From: vpavlin Date: Wed, 26 Jul 2023 11:17:49 +0200 Subject: [PATCH] chore: further gas optimization --- contracts/Rln.sol | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contracts/Rln.sol b/contracts/Rln.sol index 738353c..6f65775 100644 --- a/contracts/Rln.sol +++ b/contracts/Rln.sol @@ -36,7 +36,9 @@ contract RLN { poseidonHasher = IPoseidonHasher(_poseidonHasher); SET_SIZE = 1 << DEPTH; if (constructMembers.length > SET_SIZE) revert FullTree(); - for (uint256 i = 0; i < constructMembers.length;) { + + uint256 len = constructMembers.length; + for (uint256 i = 0; i < len;) { _register(constructMembers[i]); unchecked { ++i;