From: Aquila Date: 2005-01-18T03:06:10+09:00 Subject: Re: [SOLUTION] Ruby Quiz #15 Animal Quiz David Tran wrote: > Quick review, find a performance and memory issue ... > > The code: > if�get_answer > @node[0,1]�=�[question,�[animal],�@node.dup] > else > @node[0,1]�=�[question,�@node.dup,�[animal]] > end > > is better replace by: > temp�=�@node > if�get_answer > @node[0,1]�=�[question,�[animal],�temp] > else > @node[0,1]�=�[question,�temp,�[animal]] > end I'm very new to Ruby performance: why? In other languages this really isn't a performance neither a memory issue, what is the problem here? Always keen to learn... -- "May the source be with you"