Skip to content

[Need feedback]: Implemented isEqualToDictionary #49

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 2 commits into from
Dec 7, 2015
Merged

[Need feedback]: Implemented isEqualToDictionary #49

merged 2 commits into from
Dec 7, 2015

Conversation

KaiCode2
Copy link

@KaiCode2 KaiCode2 commented Dec 6, 2015

Implemented isEqualToDictionary and would like some feedback.

@amorde
Copy link
Contributor

amorde commented Dec 6, 2015

👍

return false
}

for (key, value) in _storage {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is NSDictionary subclassable? Then iterating over _storage wouldn't use the data from the subclass.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the solution here would be to use keyEnumerator()

Copy link
Author

Choose a reason for hiding this comment

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

@gribozavr Just corrected this issue using @amorde suggestion.

@gribozavr
Copy link
Contributor

It would be great if you included tests.

@KaiCode2
Copy link
Author

KaiCode2 commented Dec 6, 2015

@gribozavr

It would be great if you included tests.

Absolutely, I'll incorporate the tests now then do a git rebase.

@phausler
Copy link
Contributor

phausler commented Dec 6, 2015

This does not handle the CF bridged dictionary case or subclasses; _storage is only available when it is a NSDictionary constructed from swift and not a custom subclass etc.

@phausler
Copy link
Contributor

phausler commented Dec 7, 2015

Looks good to me; a great follow up for this would definitely be some unit tests. However since it looks pretty cut and dry merging it in.

phausler added a commit that referenced this pull request Dec 7, 2015
Implemented isEqualToDictionary
@phausler phausler merged commit f24b4d9 into swiftlang:master Dec 7, 2015
@KaiCode2
Copy link
Author

KaiCode2 commented Dec 9, 2015

@phausler O, thanks 😊

atrick pushed a commit to atrick/swift-corelibs-foundation that referenced this pull request Jan 12, 2021
[swift] Fix folding range for comment.url, comment.mark types
kateinoigakukun pushed a commit to kateinoigakukun/swift-corelibs-foundation that referenced this pull request Oct 11, 2023
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.

4 participants