Hacker News new | ask | show | jobs
by tom-lord 3781 days ago
Yes, you can. Ordering has been guaranteed since ruby v1.9, very much intentionally.

The implementation of a ruby hash is now as a doubly linked list [0]. This has inevitably caused a slight performance hit, but the benefits far outweigh the cost IMO.

[0] https://www.igvita.com/2009/02/04/ruby-19-internals-ordered-...