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

Rework SelectMany #604

Merged
merged 11 commits into from
Jun 19, 2018
Merged

Rework SelectMany #604

merged 11 commits into from
Jun 19, 2018

Conversation

danielcweber
Copy link
Collaborator

@danielcweber danielcweber commented Jun 18, 2018

Save some allocations and inline disposables.

@@ -875,9 +872,7 @@ public override void Run(IObservable<TSource> source)
{
_isStopped = false;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure why setting to default here is even necessary. The field is already initialized to false upon class instantiation. By removing this, you don't even need to override Run.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Right, I figured this might have been from a time where Sinks were supposed to run more than once.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Even then it makes no sense as sinks had per subscription state. Having the same sink instance service two indenpendent flows invites state clash and concurrency errors.

@@ -1110,9 +1109,7 @@ public override void Run(IObservable<TSource> source)
{
_isStopped = false;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here, init to default can be omitted.

@danielcweber danielcweber changed the title Rework select many Rework SelectMany Jun 18, 2018
@danielcweber danielcweber merged commit ad99fb5 into dotnet:master Jun 19, 2018
@danielcweber danielcweber deleted the ReworkSelectMany branch June 26, 2018 09:36
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.

2 participants