Skip to content

[NSCache] Fix incorrect priority queue operation in NSCache #1047

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
merged 1 commit into from
Jun 21, 2017

Conversation

zetasq
Copy link
Contributor

@zetasq zetasq commented Jun 18, 2017

Fix and optimize the logic for maintaining the internal priority queue NSCache.

Currently when multiple objects are set and removed in an NSCache object, the internal priority queue is not maintained correctly. The logic for maintaining the queue is correct now.

@zetasq zetasq changed the title Fix incorrect priority queue operation in NSCache [NSCache] Fix incorrect priority queue operation in NSCache Jun 18, 2017
@parkera
Copy link
Contributor

parkera commented Jun 19, 2017

Do we have some new tests to go with the fix?

@parkera parkera requested a review from ikesyo June 19, 2017 16:49
…e NSCache.

Currently when multiple objects are set into an NSCache object, the internal priority queue is not maintained correctly. The logic for maintaining the queue is correct now.
@zetasq
Copy link
Contributor Author

zetasq commented Jun 20, 2017

@parkera I just add the test_objectCorrectlyReleased test in TestNSCache suite. This test fails in the original implementation but passed in this fix. I also changed some other tests in the TestNSCache suite to make them pass.

@parkera
Copy link
Contributor

parkera commented Jun 21, 2017

@swift-ci test and merge

@swift-ci swift-ci merged commit ea41bb0 into swiftlang:master Jun 21, 2017
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