Really? Ruby allocates an Array for every iteration via Hash#each? Really?
-
-
@wycats I may be wrong I think#each_pair make an Array too. It’s so the block can take one arg and get the array. It’s ugly legacy. -
@evanphx I'm using each_key and pulling the value out. Allocation-free! -
@wycats That’s what I usually do! I typically also sort .keys and iterate that to get predictable output.
End of conversation
New conversation -
-
-
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
@wycats@evanphx So you can do Hash.each{ |pair| } (which gives you Hash.first, etc. for free).@alex_gaynor makes a good point :)Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.