[squeak-dev] The Trunk: Collections-nice.126.mcz

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

[squeak-dev] The Trunk: Collections-nice.126.mcz

commits-2
Nicolas Cellier uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-nice.126.mcz

==================== Summary ====================

Name: Collections-nice.126
Author: nice
Time: 5 September 2009, 10:21:20 am
UUID: 32bbec9c-28ef-4c94-bd03-b84942671351
Ancestors: Collections-ar.125

Avoid invoking super when self would do the job.
( super basicNew issue http://bugs.squeak.org/view.php?id=6977 )

=============== Diff against Collections-ar.125 ===============

Item was changed:
  ----- Method: OrderedCollection class>>new: (in category 'instance creation') -----
  new: anInteger
+ ^ self basicNew setCollection: (Array new: anInteger)!
- ^ super basicNew setCollection: (Array new: anInteger)!

Item was changed:
  ----- Method: OrderedCollection class>>new:withAll: (in category 'instance creation') -----
  new: anInteger withAll: anObject
+ ^ self basicNew setContents: (Array new: anInteger withAll: anObject)!
- ^ super basicNew setContents: (Array new: anInteger withAll: anObject)!

Item was changed:
  ----- Method: Set class>>new: (in category 'instance creation') -----
  new: nElements
  "Create a Set large enough to hold nElements without growing"
+ ^ self basicNew initialize: (self sizeFor: nElements)!
- ^ super basicNew initialize: (self sizeFor: nElements)!


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] The Trunk: Collections-nice.126.mcz

David T. Lewis
Related to this, SortedCollection class>>new: does nothing but call super new:
and can safely be removed. But it does have a comment that serves to document
the default sort block behavior, so leave it in the image?

Dave

On Sat, Sep 05, 2009 at 08:21:57PM +0000, [hidden email] wrote:

> Nicolas Cellier uploaded a new version of Collections to project The Trunk:
> http://source.squeak.org/trunk/Collections-nice.126.mcz
>
> ==================== Summary ====================
>
> Name: Collections-nice.126
> Author: nice
> Time: 5 September 2009, 10:21:20 am
> UUID: 32bbec9c-28ef-4c94-bd03-b84942671351
> Ancestors: Collections-ar.125
>
> Avoid invoking super when self would do the job.
> ( super basicNew issue http://bugs.squeak.org/view.php?id=6977 )
>
> =============== Diff against Collections-ar.125 ===============
>
> Item was changed:
>   ----- Method: OrderedCollection class>>new: (in category 'instance creation') -----
>   new: anInteger
> + ^ self basicNew setCollection: (Array new: anInteger)!
> - ^ super basicNew setCollection: (Array new: anInteger)!
>
> Item was changed:
>   ----- Method: OrderedCollection class>>new:withAll: (in category 'instance creation') -----
>   new: anInteger withAll: anObject
> + ^ self basicNew setContents: (Array new: anInteger withAll: anObject)!
> - ^ super basicNew setContents: (Array new: anInteger withAll: anObject)!
>
> Item was changed:
>   ----- Method: Set class>>new: (in category 'instance creation') -----
>   new: nElements
>   "Create a Set large enough to hold nElements without growing"
> + ^ self basicNew initialize: (self sizeFor: nElements)!
> - ^ super basicNew initialize: (self sizeFor: nElements)!
>

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] The Trunk: Collections-nice.126.mcz

Igor Stasenko
2009/9/6 David T. Lewis <[hidden email]>:
> Related to this, SortedCollection class>>new: does nothing but call super new:
> and can safely be removed. But it does have a comment that serves to document
> the default sort block behavior, so leave it in the image?
>
Could be moved into the class comment?

> Dave
>
> On Sat, Sep 05, 2009 at 08:21:57PM +0000, [hidden email] wrote:
>> Nicolas Cellier uploaded a new version of Collections to project The Trunk:
>> http://source.squeak.org/trunk/Collections-nice.126.mcz
>>
>> ==================== Summary ====================
>>
>> Name: Collections-nice.126
>> Author: nice
>> Time: 5 September 2009, 10:21:20 am
>> UUID: 32bbec9c-28ef-4c94-bd03-b84942671351
>> Ancestors: Collections-ar.125
>>
>> Avoid invoking super when self would do the job.
>> ( super basicNew issue http://bugs.squeak.org/view.php?id=6977 )
>>
>> =============== Diff against Collections-ar.125 ===============
>>
>> Item was changed:
>>   ----- Method: OrderedCollection class>>new: (in category 'instance creation') -----
>>   new: anInteger
>> +     ^ self basicNew setCollection: (Array new: anInteger)!
>> -     ^ super basicNew setCollection: (Array new: anInteger)!
>>
>> Item was changed:
>>   ----- Method: OrderedCollection class>>new:withAll: (in category 'instance creation') -----
>>   new: anInteger withAll: anObject
>> +     ^ self basicNew setContents: (Array new: anInteger withAll: anObject)!
>> -     ^ super basicNew setContents: (Array new: anInteger withAll: anObject)!
>>
>> Item was changed:
>>   ----- Method: Set class>>new: (in category 'instance creation') -----
>>   new: nElements
>>       "Create a Set large enough to hold nElements without growing"
>> +     ^ self basicNew initialize: (self sizeFor: nElements)!
>> -     ^ super basicNew initialize: (self sizeFor: nElements)!
>>
>
>



--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] The Trunk: Collections-nice.126.mcz

David T. Lewis
On Sun, Sep 06, 2009 at 12:23:05PM -0700, Igor Stasenko wrote:
> 2009/9/6 David T. Lewis <[hidden email]>:
> > Related to this, SortedCollection class>>new: does nothing but call super new:
> > and can safely be removed. But it does have a comment that serves to document
> > the default sort block behavior, so leave it in the image?
> >
> Could be moved into the class comment?
>

That sounds like the right thing to do. I made the change in trunk and
also added a change set to your Mantis 6977 report.

Dave