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

Specify whether the order of insertion is preserved or not #8

Open
Masterxilo opened this issue Feb 22, 2018 · 1 comment
Open

Specify whether the order of insertion is preserved or not #8

Masterxilo opened this issue Feb 22, 2018 · 1 comment

Comments

@Masterxilo
Copy link

Can you please comment on the order in which keys and values will be returned when iterating this?

JavaScript Map for instance guarantees that iterating over the map returns the keys in the order in which they where inserted.

I assume this library just preserves the order in which the keys where first inserted, and on enumerating keys and values, all values for a fixed key are returned before the key changes.

But you don't specify any guarantees about order anywhere.

This makes it hard to judge whether we can rely on any ordering or not.

In my use case, I absolutely require that the order in which values for the same key are inserted is preserved...

@KoryNunn
Copy link
Collaborator

Hey @Masterxilo, From reading the implementation I'd be pretty confident to state that the order of insersion is preserved, however, that's not 'speccd' anywhere. It would be good to add a test and documentation that asserts this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants