Skip to content

Commit

Permalink
Removed unneccessary pointer variable
Browse files Browse the repository at this point in the history
  • Loading branch information
asselstine committed Oct 6, 2021
1 parent 50e9d63 commit ed10784
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions contracts/Ticket.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ contract Ticket is ControlledToken, ITicket {
using SafeERC20 for IERC20;
using SafeCast for uint256;

/// @notice The maximum number of twab entries
uint24 internal constant MAX_CARDINALITY = 16777215; // 2**24

/// @notice Record of token holders TWABs for each account.
mapping(address => TwabLib.Account) internal userTwabs;

Expand Down Expand Up @@ -237,15 +234,14 @@ contract Ticket is ControlledToken, ITicket {
) internal view returns (uint256[] memory) {
require(_startTimes.length == _endTimes.length, "Ticket/start-end-times-length-match");

ObservationLib.Observation[MAX_CARDINALITY] storage accountTwabs = _account.twabs;
TwabLib.AccountDetails memory accountDetails = _account.details;

uint256[] memory averageBalances = new uint256[](_startTimes.length);
uint32 currentTimestamp = uint32(block.timestamp);

for (uint256 i = 0; i < _startTimes.length; i++) {
averageBalances[i] = TwabLib.getAverageBalanceBetween(
accountTwabs,
_account.twabs,
accountDetails,
_startTimes[i],
_endTimes[i],
Expand Down

0 comments on commit ed10784

Please sign in to comment.