Skip to content

Improved performance of isSubset for NSOrderedSet and NSSet #1623

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

Merged

Conversation

RobertPieta
Copy link

Improve performance by exiting early if self is larger than the potential containing set, since a larger set cannot be contained by a smaller set.

@spevans
Copy link
Contributor

spevans commented Jul 2, 2018

Looks good but I don't see any pre-existing tests for NSSet.isSubset only NSOrderedSet.isSubset. Could you add some for NSSet to ensure this new code path is covered?

@RobertPieta
Copy link
Author

@spevans absolutely!

@RobertPieta
Copy link
Author

@spevans added test case for NSSet.isSubset

@spevans
Copy link
Contributor

spevans commented Jul 3, 2018

@swift-ci please test

@millenomi
Copy link
Contributor

@swift-ci please test and merge

@RobertPieta
Copy link
Author

Just noticed the checks failed. The Swift Test Linux Platform failure reason is Not Found, so maybe the log is no longer available.

@alblue
Copy link
Contributor

alblue commented Nov 23, 2018

@swift-ci please test and merge

@swift-ci swift-ci merged commit d839794 into swiftlang:master Nov 23, 2018
@RobertPieta RobertPieta deleted the NSOrderedSet_NSSet.isSubset_performance branch November 25, 2018 03:37
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.

5 participants