OrderedCollection>>addAllFirst

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

OrderedCollection>>addAllFirst

Steve Alan Waring
Hi,

Is there a bug in OrderedCollection>>addAllFirst:?

This is a test that is failing:

testAddAllFirst
  | collection |
  collection := OrderedCollection with: 1 with: 2.
  collection removeFirst.
  collection addAllFirst: OrderedCollection new.
  self assert: collection size = 1

Thanks,
Steve

--
Steve Waring
Email: [hidden email]
Journal: http://www.stevewaring.net/blog/home/index.html


Reply | Threaded
Open this post in threaded view
|

Re: OrderedCollection>>addAllFirst

Blair McGlashan-2
"Steve Waring" <[hidden email]> wrote in message
news:bbk6gp$a6up9$[hidden email]...
> Hi,
>
> Is there a bug in OrderedCollection>>addAllFirst:?
> ...

Yes, there certainly is: Any addition of elements to a collection with free
slots at the front where the number of new elements is less than the number
of free slots will result in extra nil elements at the front of the
collection. One for the next PL.

Thanks for the report, and for providing a test too!

Blair