[squeak-dev] Collection>>sum implementation

Jason Johnson jason.johnson.081 at gmail.com
Mon Aug 11 15:35:31 UTC 2008


On Mon, Aug 11, 2008 at 5:16 PM, Stéphane Rollandin
<lecteur at zogotounga.net> wrote:
>
>>
>> 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

I know full well what allButFirst does.  That's why I said
*conceptually*.  I wanted to describe the idea in as concise a manner
as possible.  Please read the method *I actually suggested to be
included*.  No copy done there.



More information about the Squeak-dev mailing list