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

Use singleton Operators where we can #2905

Merged
merged 1 commit into from
Apr 23, 2015

Conversation

davidmoten
Copy link
Collaborator

To reduce GC pressure use singleton Operators for Observable.single, distinct, distinctUntilChanged, onBackpressureBuffer, isEmpty.

@akarnokd
Copy link
Member

Could you please do never() as well?

static final OperatorDistinct<?,?> INSTANCE = new OperatorDistinct<Object,Object>(UtilityFunctions.<Object>identity());
}

@SuppressWarnings("unchecked")
Copy link
Member

Choose a reason for hiding this comment

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

I'd add a javadoc comment here so it is more apparent the returned instance uses the identity function for comparison.

… distinctUntilChanged, onBackpressureBuffer, isEmpty
@davidmoten
Copy link
Collaborator Author

Updated javadoc and renamed create methods to instance, added singleton for never as well.

@davidmoten
Copy link
Collaborator Author

unrelated CI failure. I'll open an issue for it.

@akarnokd
Copy link
Member

Looks good!

akarnokd added a commit that referenced this pull request Apr 23, 2015
Use singleton Operators where we can
@akarnokd akarnokd merged commit a677856 into ReactiveX:1.x Apr 23, 2015
@benjchristensen benjchristensen mentioned this pull request Apr 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants