add option to sort maps by key#110
Closed
beatt83 wants to merge 1 commit intovalpackett:masterfrom
Closed
Conversation
|
@hamchapman any chance we can look to get this one merged? It looks like it solves #104 and it's would help a lot of folks (including myself). Also related to but not exactly solving the issue of |
Contributor
Author
|
@obinns-dd I had forgotten that I created this PR, since it is almost close to a year now. I can probably update my fork repo and create a release version, so it can be used by others. |
so it does not introduce breaking changes this flag is set as default to true Signed-off-by: Goncalo Frade <goncalofrade08@gmail.com>
fca4773 to
c634481
Compare
Contributor
Author
|
@obinns-dd here you go. Its updated with last changes and it has the sort order, I know not ideal but its the best I can do to help: https://github.com/beatt83/SwiftCBOR/releases/tag/0.5.1 |
Collaborator
|
Thanks a lot for the PR and sorry it's taken so long for it to be engaged with. I'm closing this one as I've incorporated it into #121. Closing as superseded by: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi there.
To contribute I added this option that I found to be useful so before encoding the encoder first sorts the keys. I found a similar logic was already being used for Map<CBOREncodable, Any> so I added the option so maps are sorted by key.
So it doesn't cause any breaking change this flag is set to true by default.