[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sc-devel] ArrayCollection:addAll



The code after a primitive is only executed if the primitive fails. Usually a primitive only implements an optimized common case and the code below it handles the general case.

So it would be wrong to remove this code.

--- james mccartney @ iphone 

On Dec 13, 2007, at 3:42 AM, ronald kuivila <rkuivila@xxxxxxxxxxxx> wrote:

Hi,

  In ArrayedCollection, the method definition of addAll uses a primitive and then does it itself,
just to make sure.  

  Commenting out the redundancy works fine.  If no objections, I will commit tonight.

   addAll { arg aCollection; 
var array;
_ArrayAddAll
array = this;
aCollection.asCollection.do({ arg item; array = array.add(item) }) ;
^array
}


RJK
_______________________________________________
Sc-devel mailing list
Sc-devel@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-devel