Re: Newbie - delete item from collection

Simon Robinson <[email protected]>
Newsgroups gmane.comp.windows.devel.dotnet.advanced
Message-ID <LISTSERV%[email protected]>
I agree, but I would also presume that the 'evaluation' consists of simply returning the value of a field that holds the current count, it's not actually being 'evaluted' in the sense of being calculated each time :-)

Simon


On Mon, 17 Nov 2008 17:23:08 -0500, Eddie Lascu <[email protected]> wrote:

>Count is a property that returns the actual number of elements contained in
>the ArrayList so has to be reevaluated every time is invoked.
>
>-----Original Message-----
>From: Discussion of advanced .NET topics.
>[mailto:[email protected]] On Behalf Of Geoff Taylor
>Sent: Monday, November 17, 2008 5:06 PM
>To: [email protected]
>Subject: Re: [ADVANCED-DOTNET] Newbie - delete item from collection
>
>Really? I thought that was cached before the first iteration of the loop and
>not re-evaluated. Does it really evaluated Count each time through the loop?
>
>     Geoff
>
>On 17 Nov 2008, at 21:04, Chris Anderson <[email protected]> wrote:
>
>>> (I'd also have expected it to throw an exception towards the end,
>>> because there are no longer _someList.Count items in the list.)
>>
>> Yes there are ;-)
>> _someList.Count will be decrementing as you remove items
>>
>> ===================================
>> View archives and manage your subscription(s) at
>> http://peach.ease.lsoft.com/archives
>
>===================================
>View archives and manage your subscription(s) at
>http://peach.ease.lsoft.com/archives
>
>===================================
>View archives and manage your subscription(s) at http://peach.ease.lsoft.com/archives

===================================
View archives and manage your subscription(s) at http://peach.ease.lsoft.com/archives
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.