Commit f299de75 authored by Will Cory's avatar Will Cory

save gas on loop

parent de1db2f7
...@@ -44,8 +44,12 @@ contract AttestationStation is Initializable, Semver { ...@@ -44,8 +44,12 @@ contract AttestationStation is Initializable, Semver {
* @param _attestations The array of attestation data. * @param _attestations The array of attestation data.
*/ */
function attest(AttestationData[] memory _attestations) public { function attest(AttestationData[] memory _attestations) public {
for (uint256 i = 0; i < _attestations.length; ++i) { uint256 length = _attestations.length;
for (uint256 i = 0; i < length; ) {
_attest(_attestations[i].about, _attestations[i].key, _attestations[i].val); _attest(_attestations[i].about, _attestations[i].key, _attestations[i].val);
unchecked {
++i;
}
} }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment