Since this code is checking true / false and then inserting bool literal true / false respecitvely, we can just use the variable.
the only other differnce between the 2 branches of the conditiional is to ensure _tokenId is 0 when _allTokens is true. We can handle that with a conditional assignment of 0, or keeping the existing value on _tokenId.
When we are looping over the something based on the length (how many hashes), we don't need to check if it's greater than 0... If it is 0, the for loop won't execute at all anyway.
This also simplified the logic and readability of the return pattern: just return from in the loop if true, and otherwise return false.
Eliminating the status variable reduces storage and complexit, and improves readability.
Two meaningful refactors here:
Clean up _allToken checks...
Since this code is checking true / false and then inserting bool literal true / false respecitvely, we can just use the variable.
the only other differnce between the 2 branches of the conditiional is to ensure _tokenId is 0 when _allTokens is true. We can handle that with a conditional assignment of 0, or keeping the existing value on _tokenId.
Refactor unneeded if statements prior to loops...
When we are looping over the something based on the length (how many hashes), we don't need to check if it's greater than 0... If it is 0, the for loop won't execute at all anyway.
This also simplified the logic and readability of the return pattern: just return from in the loop if true, and otherwise return false.
Eliminating the status variable reduces storage and complexit, and improves readability.