neo-devpack-dotnet
neo-devpack-dotnet copied to clipboard
Optimize null checks when use `IsValid`
I saw a lot of smart contracts that use this code
UInt160 hash = xxxxx;
Assert(hash != null && hash.IsValid)
this should be optimized to remove the null check because is already done in IsValid
from the syntax perspective, if hash is null, it should not be able to call IsValid.
The problem is that we already did a null check in IsValid, so or it's redudant, or we optimize it