Description
Using .AsParallel()
at the end of a LINQ query, e.g. foreach (var item in src.Select(...).Where(...).AsParallel(...))
, is a nop and should either be removed or the AsParallel()
moved earlier in the query. I've even seen developers write foreach (var item in src.AsParallel())
thinking it parallelizes the foreach
loop, which it doesn't... it'd be good to warn about such misuse.
Category: Performance