On Mon, Sep 12, 2011 at 5:09 AM, Harry Kakueki <list.push / gmail.com> wrote:
> On Mon, Sep 12, 2011 at 11:47 AM, Chris White <cwprogram / live.com> wrote:
>>
>>> I didn't mention it, but I was trying not to iterate. But, I guess I
>>> need to if I want to get more speed.

What exactly do you mean by that?  If the array is given as is and you
need to change all values there is no other way than iterating.

> I just gave a very simple example.
> I want to use larger arrays millions of times.
> The speed I have now is acceptable.
> I was just trying to squeeze a little more out to see if I could.

Well, then you could do the conversion when you *create* the nested
arrays.  That way you spare the iteration through the whole dataset.

Can you explain with more detail what your use case is?  Where do you
get the data from?  Why do you need to convert it?  Where do you put
it?  Things like that.

Kind regards

robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/