Skip to content

Commit

Permalink
Convert while to do while
Browse files Browse the repository at this point in the history
  • Loading branch information
Vectorized committed Feb 26, 2022
1 parent fac2f91 commit cf38c46
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions contracts/ERC721A.sol
Original file line number Diff line number Diff line change
Expand Up @@ -378,18 +378,18 @@ contract ERC721A is Context, ERC165, IERC721, IERC721Metadata {
uint256 end = updatedIndex + quantity;

if (safe && to.isContract()) {
while (updatedIndex != end) {
do {
emit Transfer(address(0), to, updatedIndex);
if (!_checkContractOnERC721Received(address(0), to, updatedIndex++, _data)) {
revert TransferToNonERC721ReceiverImplementer();
}
}
} while (updatedIndex != end);
// Reentrancy protection
if (_currentIndex != startTokenId) revert();
} else {
while (updatedIndex != end) {
do {
emit Transfer(address(0), to, updatedIndex++);
}
} while (updatedIndex != end);
}
_currentIndex = updatedIndex;
}
Expand Down

0 comments on commit cf38c46

Please sign in to comment.