Skip to content

Commit a085fdd

Browse files
committed
Gas optimization
1 parent 30539b9 commit a085fdd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

contracts/sfc/SFCLib.sol

+4-1
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,12 @@ contract SFCLib is SFCBase {
348348

349349
function _stashRewards(address delegator, uint256 toValidatorID) internal returns (bool) {
350350
uint256 nonStashedReward = _newRewards(delegator, toValidatorID);
351+
if (nonStashedReward == 0) {
352+
return false;
353+
}
351354
stashedRewardsUntilEpoch[delegator][toValidatorID] = _highestPayableEpoch(toValidatorID);
352355
_rewardsStash[delegator][toValidatorID] = _rewardsStash[delegator][toValidatorID] + nonStashedReward;
353-
return nonStashedReward != 0;
356+
return true;
354357
}
355358

356359
function _claimRewards(address delegator, uint256 toValidatorID) internal returns (uint256) {

0 commit comments

Comments
 (0)