Skip to content

Bad practices in example #18023

Closed
Closed

Description

@sdanyliv

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.

Activity

  1. BillWagner commented on Apr 23, 2020

    @BillWagner
    Member

    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.

  2. added this to the May 202 milestone on Apr 23, 2020
  3. removed this from the May 2020 milestone on Apr 27, 2020
  4. self-assigned this
    on Apr 27, 2020
  5. BillWagner commented on Jun 1, 2020

    @BillWagner
    Member

    This issue was fixed in #18560

  6. sdanyliv commented on Jun 1, 2020

    @sdanyliv
    Author

    @BillWagner, I hope you have not missed my comment #18560 (comment)

  7. BillWagner commented on Jun 4, 2020

    @BillWagner
    Member

    Thanks @sdanyliv

    Reopening, and assigning to me.

  8. added this to the June 2020 milestone on Jun 4, 2020
  9. added a commit that references this issue on Aug 27, 2020
    9886a10
  10. added a commit that references this issue on Aug 28, 2020
    83bdd1f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions