I\'m normally at home in C#, and I\'m looking at a performance issue in some VB.NET code -- I want to be able to compare something to the default value for a type (kind of l
The problem in your code is the IsNot
operator, not the Nothing
keyword. From the docs:
The IsNot operator determines if two object references refer to different objects. However, it does not perform value comparisons.
You're trying to do a value comparison with a reference operator. Once you realize this, either Jon Skeet's or Hans Passant's answers become obvious solutions.