Aquila
1/17/2005 6:05:00 PM
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"