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

Save some allocations in ToObservable #644

Merged
merged 1 commit into from
Jun 25, 2018
Merged

Save some allocations in ToObservable #644

merged 1 commit into from
Jun 25, 2018

Conversation

danielcweber
Copy link
Collaborator

Done by using a ValueTuple instead of a dedicated state class and passing state to IScheduler.Schedule.

}

private void LoopRec(State state, Action<State> recurse)
private void LoopRec((_ @this, ICancelable flag, IEnumerator<TSource> enumerator) state, Action<(_ @this, ICancelable flag, IEnumerator<TSource> enumerator)> recurse)
Copy link
Member

Choose a reason for hiding this comment

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

Saving allocations is okay, but readability is also important. This may be better as a struct instead of using a ValueTuple.

@danielcweber
Copy link
Collaborator Author

Revised it.

…ate class and passing state to IScheduler.Schedule.
@danielcweber danielcweber merged commit 69cf591 into dotnet:master Jun 25, 2018
@danielcweber danielcweber deleted the LessAllocationsInToObservable branch June 25, 2018 10:48
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.

3 participants