Skip to content

Commit

Permalink
Moved escape condition before unrelated logic
Browse files Browse the repository at this point in the history
  • Loading branch information
asselstine committed Jan 30, 2024
1 parent bf1d22a commit 8f024f3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/libraries/TwabLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -310,14 +310,14 @@ library TwabLib {
revert InvalidTimeRange(_startTime, _endTime);
}

uint256 offsetStartTime = _startTime - PERIOD_OFFSET;
uint256 offsetEndTime = _endTime - PERIOD_OFFSET;

// if the range extends into the shutdown period, return 0
if (isShutdownAt(_endTime, PERIOD_OFFSET)) {
return 0;
}

uint256 offsetStartTime = _startTime - PERIOD_OFFSET;
uint256 offsetEndTime = _endTime - PERIOD_OFFSET;

ObservationLib.Observation memory endObservation = _getPreviousOrAtObservation(
_observations,
_accountDetails,
Expand Down

0 comments on commit 8f024f3

Please sign in to comment.