Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SkipLast refactoring #644

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

SkipLast refactoring #644

wants to merge 1 commit into from

Conversation

Orace
Copy link
Contributor

@Orace Orace commented Nov 5, 2019

Fix #626

  • Add a test for SkipLast for ICollection input sequence
  • Add a custom implementation for SkipLast that avoid object creation for each item

- Add a custom implementation for SkipLast that avoid object creation for each item
Copy link
Contributor Author

@Orace Orace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a unit test to detect multiple calls to move next after sequence end
Use a hasNext variable.

{
queue.Enqueue(enumerator.Current);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MoveNext is called after the sequence end if it is too short
Tests should have detected that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SkipLast is not optimal
1 participant