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
Is Hash ordered based on when the entry was inserted? #7593
Comments
And more is it safe to insert new entry into Hash during the iteration of it, and will the new inserted entry be visited in the iteration? |
We should use this issue to improve the documentation. |
For 2, a Set has an order. In theory it doesn't have one, but in practice it does. Same with |
@straight-shoota Oh, I guess it's ordered then because it's built on top of |
BTW: Hash wasn't ordered in Ruby 1.8. |
Hi, everybody.
I just want to make sure whether
Hash#keys
orHash#each
returns entries in order based on when they were inserted. I found it's mentioned inHash#key_index
in document, and it looks like it's ordered viewing the code ofkey_index
. But nothing mentioned in any other place about this, and the document ofSet
saySet
based onHash
is unordered.The text was updated successfully, but these errors were encountered: