Loading the array length here isn't needed as this is already the initial value, which in turn costs extra gas:
LensHub.sol::541 - for (uint256 i = 0; i < vars.datas.length; ++i) {
PublishingLogic.sol::400 - if (byteHandle.length == 0 || byteHandle.length > Constants.MAX_HANDLE_LENGTH)
PublishingLogic.sol::403 - for (uint256 i = 0; i < byteHandle.length; ++i) {
InteractionLogic.sol::46 - if (profileIds.length != followModuleDatas.length) revert Errors.ArrayMismatch();
InteractionLogic.sol::47 - for (uint256 i = 0; i < profileIds.length; ++i) {
Initializing variables that have the same default value is unnecessary and costs extra gas.
FollowNFT.sol::120 - uint256 lower = 0;
FollowNFT.sol::162 - uint256 lower = 0;
SHR opcode uses less gas compared to DIV opcode
FollowNFT.sol::134 - uint256 center = upper - (upper - lower) / 2;
FollowNFT.sol::176 - uint256 center = upper - (upper - lower) / 2;
Loading the array length here isn't needed as this is already the initial value, which in turn costs extra gas: LensHub.sol::541 - for (uint256 i = 0; i < vars.datas.length; ++i) { PublishingLogic.sol::400 - if (byteHandle.length == 0 || byteHandle.length > Constants.MAX_HANDLE_LENGTH) PublishingLogic.sol::403 - for (uint256 i = 0; i < byteHandle.length; ++i) { InteractionLogic.sol::46 - if (profileIds.length != followModuleDatas.length) revert Errors.ArrayMismatch(); InteractionLogic.sol::47 - for (uint256 i = 0; i < profileIds.length; ++i) {
Initializing variables that have the same default value is unnecessary and costs extra gas. FollowNFT.sol::120 - uint256 lower = 0; FollowNFT.sol::162 - uint256 lower = 0;
SHR opcode uses less gas compared to DIV opcode FollowNFT.sol::134 - uint256 center = upper - (upper - lower) / 2; FollowNFT.sol::176 - uint256 center = upper - (upper - lower) / 2;