Why the order of LINQ to objects methods counts

前端 未结 5 2105
一整个雨季
一整个雨季 2021-02-14 15:58

I read this question\'s answers that explain the order of the LINQ to objects methods makes a difference. My question is why?

If I write a LINQ to SQL query, it doesn\'t

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-14 16:31

    Linq to Objects does not reorder to avoid a would-be run-time step to do something that should be optimized at coding time. The resharpers of the world may at some point introduce code analysis tools to smoke out optimization opportunities like this, but it is definitely not a job for the runtime.

提交回复
热议问题