News for hackers. Stuff that matters.
Re:C# Pattern Matching by eyegor on Tuesday February 04, 2020 @10:45PM (#22243826)
Yep, looking at the IL they are equivalent. And it definitely makes code prettier due to reduced parentheses. This is also true for generics.

Doing (x != null), !(x is null), or (x is object) all become:

    ldloc.s
    ldnull
    cgt.un
    stloc.s

There are no comments on this comment yet.