lens-protocol / core

The Lens Protocol
https://lens.xyz/
MIT License
2.77k stars 865 forks source link

Update LensHub.sol #181

Closed 0xScratch closed 4 months ago

0xScratch commented 1 year ago
for (uint256 i = 0; i < dataLength; ) {
     dataHashes[i] = keccak256(vars.datas[i]);
     unchecked {
           ++i;
      }
}

Need to appreciate the dev for this gas-efficient for loop, which most of the Repos out there fail to hook upon.. Anyways, let's back to the PR, I just changed uint256 i = 0; to uint256 i; , cuz there's really no need to initialize a uint with 0 as the default value of all unsigned and signed integers lays back to 0 itself.

Thanks!

height[bot] commented 1 year ago

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

donosonaumczuk commented 4 months ago

Did you check the gas diff output? Compiler handles this

donosonaumczuk commented 4 months ago

Thanks for your time and the submission