From 56d6b2830f7f3b7e61ba0965d388564b9cb438bc Mon Sep 17 00:00:00 2001 From: Peter Michael Date: Wed, 23 Mar 2022 18:46:13 -0400 Subject: [PATCH] refactor: Optimized post-increments to use pre-increments where possible. --- contracts/core/LensHub.sol | 2 +- contracts/core/modules/collect/LimitedFeeCollectModule.sol | 2 +- contracts/core/modules/collect/LimitedTimedFeeCollectModule.sol | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/core/LensHub.sol b/contracts/core/LensHub.sol index bdb4988..b9fb77e 100644 --- a/contracts/core/LensHub.sol +++ b/contracts/core/LensHub.sol @@ -886,7 +886,7 @@ contract LensHub is ILensHub, LensNFTBase, VersionedInitializable, LensMultiStat _collectModuleWhitelisted, _referenceModuleWhitelisted ); - _profileById[vars.profileId].pubCount++; + ++_profileById[vars.profileId].pubCount; } function _createMirror( diff --git a/contracts/core/modules/collect/LimitedFeeCollectModule.sol b/contracts/core/modules/collect/LimitedFeeCollectModule.sol index 57ff5c5..5d56ac9 100644 --- a/contracts/core/modules/collect/LimitedFeeCollectModule.sol +++ b/contracts/core/modules/collect/LimitedFeeCollectModule.sol @@ -109,7 +109,7 @@ contract LimitedFeeCollectModule is ICollectModule, FeeModuleBase, FollowValidat ) { revert Errors.MintLimitExceeded(); } else { - _dataByPublicationByProfile[profileId][pubId].currentCollects++; + ++_dataByPublicationByProfile[profileId][pubId].currentCollects; if (referrerProfileId == profileId) { _processCollect(collector, profileId, pubId, data); } else { diff --git a/contracts/core/modules/collect/LimitedTimedFeeCollectModule.sol b/contracts/core/modules/collect/LimitedTimedFeeCollectModule.sol index aaf223a..ad7c38e 100644 --- a/contracts/core/modules/collect/LimitedTimedFeeCollectModule.sol +++ b/contracts/core/modules/collect/LimitedTimedFeeCollectModule.sol @@ -120,7 +120,7 @@ contract LimitedTimedFeeCollectModule is ICollectModule, FeeModuleBase, FollowVa ) { revert Errors.MintLimitExceeded(); } else { - _dataByPublicationByProfile[profileId][pubId].currentCollects++; + ++_dataByPublicationByProfile[profileId][pubId].currentCollects; if (referrerProfileId == profileId) { _processCollect(collector, profileId, pubId, data); } else {