The Trunk: Collections-ul.359.mcz

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

The Trunk: Collections-ul.359.mcz

commits-2
Levente Uzonyi uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-ul.359.mcz

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

Name: Collections-ul.359
Author: ul
Time: 10 May 2010, 5:33:34.759 pm
UUID: 94e7e2da-ccc6-e44b-8145-e4e383b2041f
Ancestors: Collections-ul.358

- removed unused methods
- added comments

=============== Diff against Collections-ul.358 ===============

Item was changed:
  ----- Method: OrderedCollection>>growAtLast (in category 'private') -----
  growAtLast
+ "Add new empty slots to the end of array, while keeping the empty slots at the front."
 
  | newArray |
  newArray := Array new: (array size * 2 max: 1).
  newArray
  replaceFrom: firstIndex
  to: lastIndex
  with: array
  startingAt: firstIndex.
  array := newArray!

Item was changed:
  ----- Method: OrderedCollection>>growAtFirst (in category 'private') -----
  growAtFirst
+ "Add new empty slots to the front of array, while keeping the empty slots at the end."
 
  | newArray newFirstIndex newLastIndex |
  newArray := Array new: (array size * 2 max: 1).
  newFirstIndex := newArray size - array size + firstIndex.
  newLastIndex := newFirstIndex + lastIndex - firstIndex.
  newArray
  replaceFrom: newFirstIndex
  to: newLastIndex
  with: array
  startingAt: firstIndex.
  array := newArray.
  firstIndex := newFirstIndex.
  lastIndex := newLastIndex!

Item was removed:
- ----- Method: OrderedCollection>>grow (in category 'adding') -----
- grow
- "Become larger. Typically, a subclass has to override this if the subclass
- adds instance variables."
- | newArray |
- newArray := Array new: self size + self growSize.
- newArray replaceFrom: 1 to: array size with: array startingAt: 1.
- array := newArray!

Item was removed:
- ----- Method: OrderedCollection>>growSize (in category 'adding') -----
- growSize
- ^ array size max: 2!