chore: small gas optimization in a loop

This commit is contained in:
vpavlin 2023-07-12 11:39:45 +02:00
parent 58e09dcb80
commit 2e15891844

View File

@ -36,8 +36,11 @@ contract RLN {
poseidonHasher = IPoseidonHasher(_poseidonHasher);
SET_SIZE = 1 << DEPTH;
if (constructMembers.length > SET_SIZE) revert FullTree();
for (uint256 i = 0; i < constructMembers.length; i++) {
for (uint256 i = 0; i < constructMembers.length;) {
_register(constructMembers[i]);
unchecked {
++i;
}
}
}