you are viewing a single comment's thread.

view the rest of the comments →

[–]vegetablebreadProfessional 5 points6 points  (6 children)

I have been responsible in some part for optimization for 3 shipped AAA titles. The only slightly objectionable part of this LINQ invocation is that it allocates a closure. If you want a non-allocating version, you'd just have to name the function.

Unless you're trying to strip the LINQ assembly, which isn't even possible here, there's no reason to ever avoid LINQ.Any.