Why OrdeeredCollection>>removeAll

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Why OrdeeredCollection>>removeAll

Mathieu SUEN
Hi,

When I look at the code of OrderedCollection>>removeAll from de Squeak-
Web image I see:

removeAll
        "remove all elements quickly"
        self become: OrderedCollection new

It seem to me that is not a fast way of removing all element of the  
collection.
I would rather do:

removeAll

        self setCollection: (Array new: self size)

I do not see the #removeAll method in other image and by looking at  
the sender it seem that is aida who use it.

        Mth





_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Why OrdeeredCollection>>removeAll

Lukas Renggli-2
> When I look at the code of OrderedCollection>>removeAll from de  
> Squeak-
> Web image I see:
>
> removeAll
> "remove all elements quickly"
> self become: OrderedCollection new

I don't have such a method in my image.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Why OrdeeredCollection>>removeAll

Lukas Renggli-2
In reply to this post by Mathieu SUEN
> I do not see the #removeAll method in other image and by looking at
> the sender it seem that is aida who use it.

Aha, ok. Then you should post this to the aida mailing list. I guess  
#removeAll is implemented like this because it needs to be platform  
independent.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Why OrdeeredCollection>>removeAll

cedreek
In reply to this post by Lukas Renggli-2
It's Aida related ...

Cédrick

2008/2/19, Lukas Renggli <[hidden email]>:

> > When I look at the code of OrderedCollection>>removeAll from de
> > Squeak-
> > Web image I see:
> >
> > removeAll
> >       "remove all elements quickly"
> >       self become: OrderedCollection new
>
> I don't have such a method in my image.
>
> Lukas
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
>
>
> _______________________________________________
> SmallWiki, Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki