Skip to content

Commit

Permalink
Improving walletOfOwner efficiency (#233)
Browse files Browse the repository at this point in the history
* Improving walletOfOwner efficiency

* Using "_currentIndex" instead of "maxSupply"
  • Loading branch information
liarco authored Apr 12, 2022
1 parent 5886b1e commit 6b2d789
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions smart-contract/contracts/YourNftToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ contract YourNftToken is ERC721A, Ownable, ReentrancyGuard {
uint256 ownedTokenIndex = 0;
address latestOwnerAddress;

while (ownedTokenIndex < ownerTokenCount && currentTokenId <= maxSupply) {
if (_exists(currentTokenId)) {
TokenOwnership memory ownership = _ownerships[currentTokenId];
while (ownedTokenIndex < ownerTokenCount && currentTokenId < _currentIndex) {
TokenOwnership memory ownership = _ownerships[currentTokenId];

if (!ownership.burned) {
if (ownership.addr != address(0)) {
latestOwnerAddress = ownership.addr;
}
Expand Down

0 comments on commit 6b2d789

Please sign in to comment.