From: Ruby Users Ruby Users Date: 2010-08-31T00:45:39+09:00 Subject: Re: A small problem for arrays Robert Klemme wrote: > On 21.08.2010 18:27, Jean-Julien Fleck wrote: >> => [5, 6, 7] >> Array Difference---Returns a new array that is a copy of the >> original array, removing any items that also appear in other_array. >> (If you need set-like behavior, see the library class Set.) >> >> [ 1, 1, 2, 2, 3, 3, 4, 5 ] - [ 1, 2, 4 ] #=> [ 3, 3, 5 ] >> >> Cheers, >> > > Just adding to that: if Arrays are large and / or there are frequent set > operations needed then using class Set might yield better performance. > > Kind regards > > robert -- Just adding to that: if Arrays are large and / or there are frequent set -- operations needed then using class Set might yield better performance. I do't much understand what you mean. If not hard can give you an example... -- Posted via http://www.ruby-forum.com/.