You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following function calls may enumerate sequence more than twice.
if (source.Count() == 0) ...
sortedList.Count()
sortedList.ElementAt(itemIndex) ...
I think it is not good to expose for beginners such ineffective realization.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
ID: c9dc3a1f-945b-18b4-d962-467f7ca49d95
Version Independent ID: 5cf4ba6d-9afc-77bd-0a70-4ffd8e9526c0
Activity
BillWagner commentedon Apr 23, 2020
Thanks for pointing this out @sdanyliv
I'll add it to the next sprint. A similar sample is in the VB guide and should also be updated at the same time.
BillWagner commentedon Jun 1, 2020
This issue was fixed in #18560
sdanyliv commentedon Jun 1, 2020
@BillWagner, I hope you have not missed my comment #18560 (comment)
BillWagner commentedon Jun 4, 2020
Thanks @sdanyliv
Reopening, and assigning to me.
Removed multiple enumerations and handled nulls, to address #18023 (#…
update sample for LINQ how to
update sample for LINQ how to (#20312)