4 ms·
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
by tom-lord 11y 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-hash/ https://www.igvita.com/2009/02/04/ruby-19-internals-ordered-...