From: Tony Johansson on
Hello!

Can somebody explain what this text mean ?

When you call the Clear method for a Queue object, the capacity of the
Queue object is not changed.

//Tony


From: Jeff Johnson on
"Tony Johansson" <johansson.andersson(a)telia.com> wrote in message
news:u7iQCYIGLHA.6120(a)TK2MSFTNGP04.phx.gbl...

> Can somebody explain what this text mean ?
>
> When you call the Clear method for a Queue object, the capacity of the
> Queue object is not changed.

The capacity of the Queue starts out at a certain amount. As you enqueue
items, the capacity may need to increase to hold all the items. When you
clear the Queue, the capacity is not reset back to the value it originally
was when the Queue was created.

That's all.


From: Willem van Rumpt on
On 30-Jun-10 20:57, Tony Johansson wrote:
> Hello!
>
> Can somebody explain what this text mean ?
>
> When you call the Clear method for a Queue object, the capacity of the
> Queue object is not changed.
>
> //Tony
>
>

It means simply that the internal storage space for the queue is not
truncated also. More to the point, if the queue internally uses an array
to store the items, clearing the queue will remove all items from the
queue, but the internal array is not resized to reflect this.

--
Willem van Rumpt
From: Arne Vajhøj on
On 30-06-2010 14:57, Tony Johansson wrote:
> Can somebody explain what this text mean ?
>
> When you call the Clear method for a Queue object, the capacity of the
> Queue object is not changed.

It means more or less what it says.

:-)

The Clear method removes all items in the queue but does
not change the size of the backing storage.

To get rid of that you will need to call TrimToSize.

Arne