[squeak-dev] Collection>>sum implementation

Stéphane Rollandin lecteur at zogotounga.net
Mon Aug 11 15:16:52 UTC 2008


> 
> Collection>>reduce: aBlock
>       ^ self allButFirst inject: self first into: aBlock
> 

#allButFirst copies the whole collection, where in the current #sum 
implementation there is no such copy. we should avoid slowing down the 
method.

Stef




More information about the Squeak-dev mailing list