Closed Roger-Wu closed 2 years ago
The current code will not delete _availableTokens[lastIndex], when indexToUse happens to be the same as lastIndex.
delete _availableTokens[lastIndex]
indexToUse
lastIndex
We fixed this issue with this commit.
Good call! The final value should always be zero at the end of the tx because it is forever-inaccessible due to the decrement of _numAvailableTokens!
_numAvailableTokens
The current code will not
delete _availableTokens[lastIndex]
, whenindexToUse
happens to be the same aslastIndex
.We fixed this issue with this commit.