3 ms·
Actually, insertion order preservation is a 1.9 feature: > Hashes enumerate their values in the order that the corresponding keys were inserted. from http://w
by nicholaides 16y ago
Actually, insertion order preservation is a 1.9 feature:
> Hashes enumerate their values in the order that the corresponding keys were inserted.
from http://www.ruby-doc.org/core/classes/Hash.html http://www.ruby-doc.org/core/classes/Hash.html
- rue 16y agoThe docs were wrong for a long time, but looking back at the issue, there was a quiet turnaround in http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/21856 http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/.... So, hashes can be considered ordered in 1.9. It's a mistake to corrupt the data structure, in my opinion, but apparently that boat has now sailed. Thanks for the prod to recheck and sorry about the outdated info.