Skip to content

Commit

Permalink
chore(RegistrationManager): remove not needed for loop + improve comment
Browse files Browse the repository at this point in the history
  • Loading branch information
gitmp01 committed Nov 24, 2023
1 parent b30ac82 commit 475f821
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions contracts/core/RegistrationManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -521,15 +521,10 @@ contract RegistrationManager is IRegistrationManager, Initializable, UUPSUpgrade
uint16 startEpoch = currentEpoch + 1;
uint16 endEpoch = startEpoch + numberOfEpochs - 1;

// NOTE: reset _epochsTotalNumberOfGuardians if the guardian was already registered and if the current epoch is less than the
// epoch in which the current registration ends.
// NOTE: don't consider the epochs where the Guardian is
// registered already, but start from the new added ones
if (currentRegistration.owner != address(0) && currentEpoch < currentRegistrationEndEpoch) {
for (uint16 epoch = startEpoch; epoch <= currentRegistrationEndEpoch; ) {
unchecked {
--_epochsTotalNumberOfGuardians[epoch];
++epoch;
}
}
startEpoch = currentRegistrationEndEpoch;
}

_ownersGuardian[owner] = guardian;
Expand Down

0 comments on commit 475f821

Please sign in to comment.