You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most of the comparers perform type-checking using the following pattern:
if(xisDesiredType)((DesiredType)x).DoSomething()
Newer versions of C# added the ability to avoid the second cast by defining a temp variable.
if(xisDesiredTypedt)dt.DoSomething()
This helps simplify code and provides a small perf boost by avoiding an unneccessary cast. This could also minimize future changes if the comparers ever get a generic overload as pattern matching can play nicer than casts in that case
Activity