[squeak-dev] OrderedCollection grow behaviour

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

[squeak-dev] OrderedCollection grow behaviour

Chiricozzi Walter
Hi all,
Is it  safe to modify the OrderedCollection behaviour this way?


OrderedCollection >> grow

| t1 |
        t1 := Array new: self growSize.
        t1
                replaceFrom: 1
                to: array size
                with: array
                startingAt: 1.
        array := t1

OrderedCollection >> growsize
growSize
        ^ array size * 2

TIA



-------------------------------
Message for the recipient only, if received in error, please notify the sender and read www.enav.it/disclaimer

Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: OrderedCollection grow behaviour

Andreas.Raab
Chiricozzi Walter wrote:
> Hi all,
> Is it  safe to modify the OrderedCollection behaviour this way?

Yes, since it is identical to the current implementation.

Cheers,
   - Andreas

>
>
> OrderedCollection >> grow
>
> | t1 |
> t1 := Array new: self growSize.
> t1
> replaceFrom: 1
> to: array size
> with: array
> startingAt: 1.
> array := t1
>
> OrderedCollection >> growsize
> growSize
> ^ array size * 2
>
> TIA
>
>
>
> -------------------------------
> Message for the recipient only, if received in error, please notify the sender and read www.enav.it/disclaimer
>
>