From: Rick DeNatale Date: 2008-09-18T21:44:23+09:00 Subject: Re: Preserve insert order in a Hash ------=_Part_35694_4351438.1221742321462 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Thu, Sep 18, 2008 at 6:28 AM, Yukihiro Matsumoto wrote: > Hi, > > In message "Re: Preserve insert order in a Hash" > on Thu, 18 Sep 2008 18:54:20 +0900, "Thomas B." > writes: > > |Could anybody explain why this feature was added? > > Useful for some cases, especially for keyword arguments. > > |Isn't it going to slow down the operations on the Hash? > > No. hash reference operation does not touch order information, only > for iteration. Memory consumption increased a bit. > If I remember correctly, it's been a while since I looked at the code, 1.9 implements this by using a singly linked list which introduces a small overhead only when elements are either added or deleted. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ ------=_Part_35694_4351438.1221742321462--