News for hackers. Stuff that matters.
Re:Never trust a system that seems to be working by hardware2win on Tuesday October 18, 2022 @02:59AM (#33243905)
C# linqs method - first or default has the same problem
Re:Never trust a system that seems to be working by int_19h on Wednesday October 19, 2022 @05:11PM (#33267994)
The method itself just uses the default value of the corresponding type. If you have a sequence of ints, and you cast it to Nullable<int> first before applying FirstOrDefault, then you can distinguish between null and 0.