Skip to content

Commit

Permalink
refactor: shorten if
Browse files Browse the repository at this point in the history
  • Loading branch information
alpanaca committed Aug 22, 2024
1 parent c8dea5f commit 155a84a
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,7 @@ contract xALPACAv2Rewarder is IxALPACAv2Rewarder, OwnableUpgradeable, Reentrancy
uint256 _totalUserAmount = IxALPACAv2RevenueDistributor(xALPACAv2RevenueDistributor).getUserTotalAmountOf(_user);
int256 _userAccumReward = ((_totalUserAmount * _accRewardPerShare) / ACC_REWARD_PRECISION).toInt256();

if (_userAccumReward < _userInfo.rewardDebt) {
return 0;
}
return (_userAccumReward - _userInfo.rewardDebt).toUint256();
return _userAccumReward > _userInfo.rewardDebt ? (_userAccumReward - _userInfo.rewardDebt).toUint256() : 0;
}

/// @dev Perform the actual updatePool
Expand Down

0 comments on commit 155a84a

Please sign in to comment.