From: Daniel Brockman Date: 2005-07-13T12:25:41+09:00 Subject: Re: Updating GUIs Joe Van Dyk writes: > On 7/12/05, Daniel Brockman wrote: >> Joe Van Dyk writes: >> >>> player.polygon = player.polygon.collect do |x,y| >> >> How about this? >> >> player.polygon.collect! do |x,y| > > Didn't increase speed at all. Hmm, okay. > Is there some Ruby idiom for going through every element in an array > and destructively changing the values in it? Using collect! didn't > seem to help at all. Well, that *is* how you destructively change each element. I guess the array consing wasn't your bottleneck. I'd look at your algorithm more closely if I weren't so damn tired --- sorry. -- Daniel Brockman