T
Timo Jeranko
At the moment I'm doing something like this:
def some_method(array1)
...
array2 = array1.clone
...
array2.delete_at(i)
...
return array2
...
end
I would like array1 to remain unchanged. It seems a little inefficient
to clone array1 every time some_method is called. Is there a more
elegant solution?
def some_method(array1)
...
array2 = array1.clone
...
array2.delete_at(i)
...
return array2
...
end
I would like array1 to remain unchanged. It seems a little inefficient
to clone array1 every time some_method is called. Is there a more
elegant solution?